Skip to content

Instantly share code, notes, and snippets.

View dannluciano's full-sized avatar
🏠
Working from home

Dann Luciano dannluciano

🏠
Working from home
View GitHub Profile

Brazilian TLD Applicants

TLD Company
.ITAU Itau Unibanco Holding S.A.
.BRADESCO Banco Bradesco S.A.
.IPIRANGA Ipiranga Produtos de Petroleo S.A.
.BOM Núcleo de Informação e Coordenação do Ponto BR - NIC.br
.FINAL Núcleo de Informação e Coordenação do Ponto BR - NIC.br
.RIO Empresa Municipal de Informática SA - IPLANRIO
@infoslack
infoslack / Dockerfile
Created October 8, 2014 05:26
Demo Docker on Rails
FROM ubuntu:trusty
# Update the repository
RUN apt-get update
# Install necessary tools
RUN apt-get install -y wget net-tools build-essential git
# Setup Install Nginx
RUN wget -q -O - http://nginx.org/keys/nginx_signing.key | apt-key add -
import java.util.HashSet;
import java.util.Set;
import java.util.stream.IntStream;
public class HappyNumber {
public static void main(String[] args) {
IntStream.range(0, args.length == 0 ? 1001 : Integer.parseInt(args[0]))
.parallel()
.filter((number) -> {
@macournoyer
macournoyer / tm_reveal_in_github.rb
Created January 14, 2011 15:31
Reveal in GitHub TextMate command
#!/usr/bin/env ruby
# Reveal in GitHub TextMate command
require 'pathname'
path = Pathname.new(ENV["TM_FILEPATH"]).relative_path_from(Pathname.new(ENV["TM_PROJECT_DIRECTORY"]))
repo_path = `/usr/local/bin/git remote show origin`[/Fetch URL: git@(.*)\.git$/, 1].tr(":", "/")
branch = `/usr/local/bin/git symbolic-ref HEAD`[/refs\/heads\/(.*)$/, 1]
exec "open 'http://#{repo_path}/blob/#{branch}/#{path}'"
@rafaelp
rafaelp / gist:1925879
Created February 27, 2012 18:01
Is Ruby Javascript like?
ruby-1.9.2-p290 :001 > 0/0
ZeroDivisionError: divided by 0
from (irb):1:in `/'
from (irb):1
from /Users/rafael/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `<main>'
ruby-1.9.2-p290 :002 > 1.0/0
=> Infinity
ruby-1.9.2-p290 :003 > 0.0/0
=> NaN
ruby-1.9.2-p290 :004 >
@rafaelp
rafaelp / gist:1976687
Created March 5, 2012 04:55
A solution to a more obscure problem related to the "vulnerability" of mass assignment:
# account.rb
class Account < ActiveRecord::Base
has_many :users
has_many :services
end
# user.rb
class User < ActiveRecord::Base
belongs_to :account
end
@lucascaton
lucascaton / 0-readme.md
Created March 11, 2012 23:41 — forked from burke/0-readme.md
ruby-1.9.3-p125 cumulative performance patch.

Patched ruby 1.9.3-p125 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p125 with patches to make ruby-debug work again (#47) and boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Huge thanks to funny-falcon for the performance patches.

@mistersourcerer
mistersourcerer / _.js
Created April 13, 2012 17:30 — forked from guilhermesilveira/gist:2378419
abusing _ scala in javascript
Array.prototype.map = function(f) {
return this.fold([], function(current, el) {
return [f(current)].concat(el);
});
}
Number.prototype.sum = function(val) {
return this + val;
}
@dimiro1
dimiro1 / abnt-CEUT.sty
Created June 4, 2012 19:23
ABNT CEUT
%% Copyright (C) 2011 Claudemiro Feitosa <dimiro1@gmail.com>
%%
%% Fortemente baseado no abnt-UFPR.sty
%%
\NeedsTeXFormat{LaTeX2e}
\usepackage[utf8]{inputenc}
%% http://www.terminally-incoherent.com/blog/2006/12/17/latex-numbered-subsubsections/
@fnando
fnando / dnsimple_backup.rb
Created July 24, 2012 02:26
Backup your DNSimple records
# gem install dnsimple-ruby
# $ <SPACE>PASSWORD="your password" EMAIL="your e-mail" ruby dnsimple_backup.rb > dnsimple_backup.yml
# when you put a space before running a command you prevent it from being added to the history.
require "dnsimple"
require "yaml"
DNSimple::Client.username = ENV.fetch("EMAIL")
DNSimple::Client.password = ENV.fetch("PASSWORD")