ruby:
/\A[^@]+@[^@]+\z/
js:
/^[^@]+@[^@]+$/
var fs = require('fs'); | |
var content = fs.readFileSync('./fontello-ie7.css','utf-8'); | |
if( content.indexOf('~"expression(') !== -1 ){ | |
console.info("fontello-ie7.css have been converted."); | |
process.exit(0); | |
} | |
content = content.replace(/expression\((.*)\);/g, function(){ |
element.addClass('animated swing'); | |
setTimeout(function(){ | |
element.removeClass('animated swing'); | |
},500); |
//phantomjs pdf.js | |
var page = require('webpage').create(); | |
page.paperSize = { | |
format: 'A4', | |
orientation: "landscape" | |
}; | |
page.viewportSize = { width: 1200, height: 4347 }; |
gem install gimli -V | |
gimli -f foo.md -s https://github.github.com/github-flavored-markdown/shared/css/documentation.css |
gem install mailcatcher --both --no-ri --no-rdoc -V | |
kill -9 $(lsof -i:1025 -t) 2> /dev/null | |
mailcatcher | |
export SMTP_SERVER="127.0.0.1" | |
export SMTP_PORT=1025 |
var BitMask = function(){ | |
}; | |
BitMask.prototype = { | |
// & ANDing | |
test : function(flags,mask){ | |
return (flags & mask) == mask; | |
}, | |
// | ORing |
//f(n) = 1 + 3 + 5 + ... + (2n + 1) n >= 0 | |
function loopCount(n){ | |
var total = 0; | |
for(var i = 0; i <= n; i++){ | |
total = total + (2 * i + 1) | |
} | |
return total; | |
} |
ruby:
/\A[^@]+@[^@]+\z/
js:
/^[^@]+@[^@]+$/
module Sinatra | |
module AssetPack | |
class Package | |
def to_development_html(path_prefix, options={}) | |
if js? | |
return paths_and_files.map { |path, file| | |
path = add_cache_buster(path, file) | |
path = add_path_prefix(path, path_prefix) | |
link_tag(path, options) | |
}.join("\n") |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>hover transform</title> | |
<style type="text/css"> | |
.gallery{ | |
width: 388px; | |
height: 200px; | |
overflow: hidden; |