Skip to content

Instantly share code, notes, and snippets.

View LucasArruda's full-sized avatar
🎯
Focusing

Lucas Arruda LucasArruda

🎯
Focusing
View GitHub Profile

Keybase proof

I hereby claim:

  • I am lucasarruda on github.
  • I am lucasarruda (https://keybase.io/lucasarruda) on keybase.
  • I have a public key whose fingerprint is F895 D87F A05A 3939 8E1D A9BF E6A0 E155 A547 ACD7

To claim this, I am signing this object:

@LucasArruda
LucasArruda / quick-deploy-heroku-git.txt
Last active August 29, 2015 14:10
Quick deploy to Heroku from git repo
## summary
git remote add heroku git@heroku.com:heroku_app_name.git
git push heroku master
heroku open
## commented steps
# (if you haven't) add keys to heroku so you can push
heroku keys:add
@LucasArruda
LucasArruda / create-iso-from-dvd.sh
Created November 5, 2014 01:58
Create iso - OSX
#!/bin/sh
# see what's the correct disk #
mount
# change disk2 to correct disc number
sudo diskutil unmount /dev/disk2
dd if=/dev/disk1 of=~/mydvd.iso bs=2048 conv=sync,notrunc
@LucasArruda
LucasArruda / cup.py
Last active August 29, 2015 14:02
World Cup 2014 results on terminal
from urllib2 import urlopen
import json
resp = urlopen('http://worldcup.sfg.io/matches/?by_date=DESC').read()
for jogo in json.loads(resp):
complete = (jogo['status'] == 'completed')
current = (jogo['status'] == 'in progress')
if complete or current:
ht = jogo['home_team']

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

Results

module.exports = function(grunt) {
var config = {};
// Set all the tasks you want to load.
var tasks = [
, "grunt-contrib-concat"
, "grunt-contrib-uglify"
, "grunt-contrib-jshint"
, "grunt-contrib-watch"
];
GIT_VERSION=`git --version | awk '{print $3}'`
URL="https://raw.github.com/git/git/v$GIT_VERSION/contrib/completion/git-completion.bash"
OTHER_URL="https://raw.githubusercontent.com/git/git/v$GIT_VERSION/contrib/completion/git-completion.bash"
PROFILE="$HOME/.profile"
echo "Downloading git-completion for git version: $GIT_VERSION..."
if ! curl "$URL" --silent --output "$HOME/.git-completion.bash"; then
echo "ERROR: Couldn't download completion script. Make sure you have a working internet connection." && exit 1
@LucasArruda
LucasArruda / async_load.text
Last active December 20, 2015 01:38
Load a script asynchronously
(function() { var e = document.createElement('script'); e.type = 'text/javascript'; e.async = true; e.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(e, s); })();
@LucasArruda
LucasArruda / .bash_profile
Last active May 26, 2016 14:08
Quick 'n dirty nice .bash_profile for OS X
# USE IF YOU HAVE
#export JAVA15_HOME="/System/Library/Java/JavaVirtualMachines/1.5.0/Contents/Home/"
#export PATH=${JAVA15_HOME}/bin:$PATH
export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=${JAVA_HOME}/bin:$PATH
#export MAVEN_OPTS="-Xmx1024m -Xms1024m -XX:MaxPermSize=1162m"
#export M2_HOME=/usr/local/apache-maven-2.2.1
#export M2=$M2_HOME/bin
#export PATH=$M2:$PATH
export M2_HOME=/Applications/apache-maven-3.2.3
@LucasArruda
LucasArruda / giffy
Created June 5, 2013 17:28 — forked from fnando/giffy
#!/usr/bin/env bash
if [[ ! -f "$1" ]]; then
echo "=> Movie file not found"
exit 1
fi
tempfile=/tmp/output.gif
rm -f $tempfile