Skip to content

Instantly share code, notes, and snippets.

View LucasArruda's full-sized avatar
🎯
Focusing

Lucas Arruda LucasArruda

🎯
Focusing
View GitHub Profile

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

@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']
@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 / 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

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 / uri.js
Last active August 29, 2015 14:16 — forked from jlong/uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@LucasArruda
LucasArruda / add-css-vanilla.js
Last active August 29, 2015 14:25
Add CSS or JS on the fly
function loadCss(url) {
var link = document.createElement("link");
link.type = "text/css";
link.rel = "stylesheet";
link.href = url;
document.getElementsByTagName("head")[0].appendChild(link);
}
@LucasArruda
LucasArruda / fix_brew.sh
Created October 6, 2015 15:17
Fixing brew
#!/bin/sh
cd $(brew --prefix) && git fetch && git reset --hard origin/master
brew update
@LucasArruda
LucasArruda / install-sublime.sh
Created September 27, 2012 20:43
Install Sublime Text 2
#!/bin/sh
# Script to install a downloaded 'Sublime Text 2' editor.
# Make sure you follow the editors license
if [ -z "$1" ]
then
echo "\n Function usage:"
echo " $ ./install-sublime.sh Sublime\ Text\ 2.0.1.tar.bz2"
echo "\n (replace tar.bz2 file with correct name)"
@LucasArruda
LucasArruda / install-updates.sh
Created September 27, 2012 20:44
Script to install system-wide updates
#!/bin/sh
# Script to install system-wide updates
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get autoremove
sudo apt-get clean