Skip to content

Instantly share code, notes, and snippets.

View filipesperandio's full-sized avatar

Filipe Esperandio (Pippo) filipesperandio

  • CodeClimate
  • porto alegre, brazil
  • 08:08 (UTC -03:00)
View GitHub Profile
@filipesperandio
filipesperandio / keybase.md
Last active August 29, 2015 14:27
keybase.md

Keybase proof

I hereby claim:

  • I am filipesperandio on github.
  • I am filipesperandio (https://keybase.io/filipesperandio) on keybase.
  • I have a public key whose fingerprint is 4DE3 6277 76E2 33AF 5077 3663 AF5F 43FE A9DB D87C

To claim this, I am signing this object:

@filipesperandio
filipesperandio / allow_ssh.sh
Last active August 29, 2015 14:21
Allow for non-password ssh
#!/usr/bin/env bash
SERVER=$1
ssh $SERVER mkdir -p .ssh
cat ~/.ssh/id_rsa.pub | ssh $SERVER "cat >> .ssh/authorized_keys"
#!/usr/bin/env bash
echo "Installing docker"
wget -qO- https://get.docker.com/ | sudo sh
sudo usermod -aG docker filipesperandio
echo "Installing SMB/CIFS and local net discovery"
sudo apt-get install cifs-utils pyNeighborhood
echo "Mounting NAS"
@filipesperandio
filipesperandio / childFromParent.groovy
Last active September 17, 2016 20:47
Groovy construct child from parent
class Parent {
def fieldA
Map asMap() {
this.class.declaredFields.findAll { !it.synthetic }.collectEntries {
["${it.name}": this[it.name]]
}
}
}
@filipesperandio
filipesperandio / rake.rb
Created August 5, 2013 11:56
Rake routes for a Sinatra App
require "sinatra/activerecord/rake"
require "./your_app"
task :routes do
["GET", "POST", "PUT", "DELETE"].each do |verb|
routes = Sinatra::Application.routes[verb] || []
routes.as_json.flatten.each do |params|
puts params["route_name"] if params.is_a? Hash
end
end
@filipesperandio
filipesperandio / angular_directive_declaration.js
Last active December 18, 2015 19:39
Basic Angular Directive Definition
var directiveFunction = function() {
return function(scope, element, att) {
console.log(scope); //scope is the real angular scope related to that DOM element
console.log(element); //element is a jquery like object and has a subset of jquery functions -> http://docs.angularjs.org/api/angular.element
console.log(att); //att has the attributes you pass on the directive
console.log(att.something); // fulano
}
};
module.directive("something", directiveFunction );