Skip to content

Instantly share code, notes, and snippets.

View gabrielengel's full-sized avatar

Gabriel Engel gabrielengel

  • Porto Alegre
  • 03:33 (UTC -03:00)
View GitHub Profile
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);
@gabrielengel
gabrielengel / ruby-gmail.md
Created August 9, 2014 14:31
New Ruby-Gmail Interface

Require gmail

require 'gmail'

Start an authenticated gmail session

Gmail.new(username, password) do |gmail|
  # ...do things...
end
@gabrielengel
gabrielengel / edit.html
Created April 27, 2015 20:00
Edit CSS Here
<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>
@gabrielengel
gabrielengel / bancos_brasil.json
Last active January 31, 2019 21:20
bancos do brasil
[
"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",
@gabrielengel
gabrielengel / passports_regexp.rb
Created September 21, 2020 18:14
Regular Expressions for passports
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}$/,