ms.
px.
(from here):
Highlight
2020-02-27
2019-05-07
2016-12-13
More info
I tend to more easily post tech news at GitHub Gist, Google+, and older Google+ now. See also my old snippets and user styles.
2015-10-14
My Firefox won't paste text! A workaround using AutoHotkey.
In Firefox I often find myself unable to paste into Facebook or YouTube comment boxes. I've been a Mozilla fan since 3.0, but bugs like these make Firefox a pain. Here's a workaround that works in my 64-bit Windows 7:
- Install AutoHotkey.
- Save this script as "type_clipboard.ahk":
; http://www.autohotkey.com/board/topic/76296-type-out-text-in-clipboard/ ; ctrl+win+v ^#v:: sendraw %clipboard% return - Run the script and press Ctrl+Win+V to have AutoHotkey type your clipboard text into Firefox.
Labels:
AutoHotkey,
bug,
code,
firefox,
script,
workaround
2015-03-05
#TheDress
The dress is Coffee and Cool grey according to my new script:
What's that color?
Try these context-dependent colors: rgb(113,94,58) and rgb(135,154,189)
2014-11-04
Cyrillic to Latin
Tired of unreadable Russian characters? Try this JavaScript:
var Cyrillic_Latin = {
"А":"A", "а":"a",
"Б":"B", "б":"b",
"В":"V", "в":"v",
"Г":"G", "г":"ɡ",
"Д":"D", "д":"d",
"Е":"Je", "е":"e",
"Ё":"Jo", "ё":"jo",
"Ж":"S", "ж":"s",
"З":"Z", "з":"z",
"И":"I", "и":"i",
"Й":"J", "й":"j",
"К":"K", "к":"k",
"Л":"L", "л":"l",
"М":"M", "м":"m",
"Н":"N", "н":"n",
"О":"O", "о":"o",
"П":"P", "п":"p",
"Р":"R", "р":"r",
"С":"S", "с":"s",
"Т":"T", "т":"t",
"У":"U", "у":"u",
"Ф":"F", "ф":"f",
"Х":"X", "х":"x",
"Ц":"Ts", "ц":"ts",
"Ч":"Tj", "ч":"tj",
"Ш":"Sh", "ш":"sh",
"Щ":"Sh", "щ":"sh",
"Ъ":"", "ъ":"",
"Ы":"E", "ы":"e",
"Ь":"ʲ", "ь":"ʲ",
"Э":"E", "э":"e",
"Ю":"Ju", "ю":"ju",
"Я":"Ja", "я":"ja",
"І":"I", "і":"i",
"Ѳ":"F", "ѳ":"f",
"Ѣ":"E", "ѣ":"e",
"Ѵ":"I", "ѵ":"i",
"Ѕ":"Z", "ѕ":"z",
"Ѯ":"Ks", "ѯ":"ks",
"Ѱ":"Ps", "ѱ":"ps",
"Ѡ":"O", "ѡ":"o",
"Ѫ":"Ju", "ѫ":"ju",
"Ѧ":"Ja", "ѧ":"ja",
"Ѭ":"Ju", "ѭ":"ju",
"Ѩ":"Ja", "ѩ":"ja"
}
function Cyr2Lat(text){
var out = ""
for(i in text) out += Cyrillic_Latin[text[i]] || text[i]
return out
}
Example:Cyr2Lat("чем")
"tjem"
Cyr2Lat("форма")
"forma"
Here it is as a bookmarklet that converts the current page (thanks to this snippet):
javascript:(function(){function t(t){var n="";for(var i in t)n+=e[t[i]]||t[i];return n}function n(e){if(e.nodeType==3&&e.nodeValue.trim()!=""){e.nodeValue=t(e.nodeValue)}else{for(var i=e.childNodes.length-1;i>=0;--i){n(e.childNodes[i])}}}var e={"А":"A","а":"a","Б":"B","б":"b","В":"V","в":"v","Г":"G","г":"ɡ","Д":"D","д":"d","Е":"Je","е":"e","Ё":"Jo","ё":"jo","Ж":"S","ж":"s","З":"Z","з":"z","И":"I","и":"i","Й":"J","й":"j","К":"K","к":"k","Л":"L","л":"l","М":"M","м":"m","Н":"N","н":"n","О":"O","о":"o","П":"P","п":"p","Р":"R","р":"r","С":"S","с":"s","Т":"T","т":"t","У":"U","у":"u","Ф":"F","ф":"f","Х":"X","х":"x","Ц":"Ts","ц":"ts","Ч":"Tj","ч":"tj","Ш":"Sh","ш":"sh","Щ":"Sh","щ":"sh","Ъ":"","ъ":"","Ы":"E","ы":"e","Ь":"ʲ","ь":"ʲ","Э":"E","э":"e","Ю":"Ju","ю":"ju","Я":"Ja","я":"ja","І":"I","і":"i","Ѳ":"F","ѳ":"f","Ѣ":"E","ѣ":"e","Ѵ":"I","ѵ":"i","Ѕ":"Z","ѕ":"z","Ѯ":"Ks","ѯ":"ks","Ѱ":"Ps","ѱ":"ps","Ѡ":"O","ѡ":"o","Ѫ":"Ju","ѫ":"ju","Ѧ":"Ja","ѧ":"ja","Ѭ":"Ju","ѭ":"ju","Ѩ":"Ja","ѩ":"ja"};n(document)})()
2014-10-03
Useful comments
While the comments in my Assembly post were useful to beginners, experts who can read the code might find them annoying.
Here's an example of helpful comments for experienced programmers:
function delete_month(id, index){
load_branch(id)
$(".row[id^="+id+"] .cell:nth-child("+(index+1)+")").each(function(i,e){
if(i==0 && e.className.indexOf("draggable")<0) return // only change sandbox budget.
$(this).nextAll().each(function(i,e){
this.style.left = (parseInt(this.style.left)-mw)+"px"
cellBlur(this) // update availability
}).addClass("changed")
$(this).prevAll().addClass("changed") // needed in case there is no next cell.
$(this).remove()
})
//updateTotals() // too slow here
btnSave.value = "Save*"
setBusy(0)
}
Note that i'm describing WHY the code is there, not HOW it works (which should be obvious to any decent JavaScript coder, who also should have an editor capable of wrapping lines to their preferred width).
Subscribe to:
Posts (Atom)