require 'gmail'
Gmail.new(username, password) do |gmail|
# ...do things...
end
passports = { | |
_generic: /^(\b([A-Za-z]\s*){1,2}\s*(\d\s*){7})/, | |
austria: /^[A-z] ?[0-9]{7}$/, | |
belgium: /^[A-z]{2}[0-9]{6}$/, | |
bulgaria: /^[0-9]{9}$/, | |
croatia: /^[0-9]{9}$/, | |
cyprus: /^[A-z][0-9]{6,8}$/, | |
czech: /^[0-9]{8}$/, | |
denmark: /^[0-9]{9}$/, | |
estonia: /^[A-z][0-9]{7}$/, |
[ | |
"001 - Banco do Brasil", | |
"003 - Banco da Amazônia", | |
"004 - Banco do Nordeste", | |
"021 - Banestes", | |
"025 - Banco Alfa", | |
"027 - Besc", | |
"029 - Banerj", | |
"031 - Banco Beg", | |
"033 - Banco Santander Banespa", |
<a href='javascript:el=document.createElement("style");el.style.display="block";el.style.position="absolute";el.style.bottom="0";el.style.right="0";el.style.left="0";el.style.background="#fff";el.contentEditable=true;el.innerHTML="body{background: lightgreen;}";document.body.appendChild(el);event.preventDefault();'> | |
Edit CSS | |
</a> |
window.Timer = { | |
countdown: function(minutes,seconds){ | |
var currentTime = new Date().getTime(); | |
Timer.finishTime = currentTime + (minutes * 60 * 1000) + (seconds * 1000); | |
Timer.running = setInterval("Timer.ended()",1000) | |
}, | |
ended: function(){ | |
var currentTime = new Date().getTime(); | |
console.log('Now: ' + currentTime + ' - ends: ' + Timer.finishTime); |
// Editor specific listener | |
editor.on("aftercommand:composer", resize); // Set bold, italic, etc | |
editor.on("change_view", resize); // Change wysi/source view | |
// Typing listeners | |
editor.on("newword:composer", resize); // Only way to observe on firefox | |
editor.on("undo:composer", resize); | |
editor.on("paste", resize); | |
iframeBody.addEventListener('keyup', resize, false); | |
iframeBody.addEventListener("keydown", resize, false); |
/** | |
* @license wysihtml5 v0.4.0pre | |
* https://github.com/xing/wysihtml5 | |
* | |
* Author: Christopher Blum (https://github.com/tiff) | |
* | |
* Copyright (C) 2012 XING AG | |
* Licensed under the MIT license (MIT) | |
* | |
*/ |
/* | |
wysihtml5 v0.4.0pre + autoresize On Chrome | |
https://github.com/xing/wysihtml5 | |
Author: Christopher Blum (https://github.com/tiff) | |
Copyright (C) 2012 XING AG | |
Licensed under the MIT license (MIT) | |
Rangy, a cross-browser JavaScript range and selection library |
def symbol_array_from_string(value) | |
regex = /\[((:([^ ,\]])+) *,{0,1} *)+\]/ | |
return value unless value =~ regex | |
value.scan(/:[^ ,\]]+/).map{|v| v.gsub(/^:/,'').to_sym} | |
end | |
result = symbol_array_from_string("[:a, :apple,:dog]") | |
result == [:a, :apple, :dog] |
#!/usr/bin/env bash | |
# Setup a ubuntu 12.04 LTS machine with nginx, unicorn, ruby 1.9.3 | |
# RUN: curl -L http://goo.gl/M8SXl | bash | |
mkdir ~/server ; cd ~/server | |
wget https://github.com/gabrielengel/chef-ubuntu/tarball/master | |
tar -zxf master | |
cd gab* | |
mv dna.aws-sample.json dna.json |