running scanner on arch linux

first all we need install packages called SANE sudo pacman -S sane then show list scanner we want use $ scanimage -L device `v4l:/dev/video0′ is a Noname UVC Camera (eb1a:013a) virtual device device `pixma:04A9174E_517EB0′ is a CANON Canon PIXMA MX410 multi-function peripheral the device called pixma:04A9xxxxxxx is my plug scanner, then input your document into scanner. and running this command on your fucking shell. $scanimage … Continue reading running scanner on arch linux

Allow webfonts in subdomain with .htaccess

setting your htaccess with below script (ex: in your asset domain or cookieless free domain) # Allow access from all domains for webfonts. # Alternatively you could only whitelist your # subdomains like “”. Header set Access-Control-Allow-Origin “*” fucking done. source: Continue reading Allow webfonts in subdomain with .htaccess

word_limit with javascript

create this function function truncate( n, useWordBoundary ){ var isTooLong = this.length > n, s_ = isTooLong ? this.substr(0,n-1) : this; s_ = (useWordBoundary && isTooLong) ? s_.substr(0,s_.lastIndexOf(‘ ‘)) : s_; return isTooLong ? s_ + ‘…’ : s_; }; how to use? var string = “Hello world one two three four five six seven eight nine ten”; truncate.apply(string, [10, true]) source: stackoverflow Continue reading word_limit with javascript