This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Foca no código | |
.---. | |
/o o\ | |
__(= " =)__ | |
//\'-=-'/\\ | |
) (_ | |
/ `"=-._ | |
/ \ ``"=. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var CPF = (function () { | |
var eleven = 11; | |
function mod(n) { | |
var t = eleven, | |
a = n % t; | |
return (a < 2 ? 0 : t - n % t) + ''; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var utils = {}; | |
utils.vogal = function (str) { | |
var h = Object.prototype.hasOwnProperty, | |
v = (str + '').replace(/[^aeiou]/g, ''), | |
d = {}, | |
n; | |
for (var i in v) { | |
n = v[i]; | |
if (h.call(d, n)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function nextDay() { | |
var date = new Date(2014, month, now + 1); | |
now = date.getDate(); | |
return date; | |
} | |
var month = 9, | |
now = 0, | |
max = 50, | |
curr; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function type(e) { | |
var t = Object.prototype.toString.call(e), | |
r = /\[object (\w+)\]/i.exec(t); | |
return r && r[1].toLowerCase(); | |
} | |
[1,"2", true, null, [], {}, function() {}, undefined].forEach(function(e){ | |
console.log(type(e)) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RESIZE AND OPTIMIZE (based in height) | |
HEIGHT=500 | |
mkdir -p result | |
for f in *.jpg; do | |
convert "$f" -resize "x${HEIGHT}" -strip -quality 90% "result/$f" | |
done | |
# THUMB | |
WIDTH=200 | |
HEIGHT=225 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xbox-convert() { | |
if test $# -eq 1; then | |
local extension=$(echo "$1" | egrep -o '\.[^\.]+$') | |
local file=$(echo "$1" | sed -e "s/"$extension"$//") | |
if test -f "$file.srt" && test -f "$1"; then | |
ffmpeg -sub_charenc "ISO-8859-1" -i "$file.srt" "$file.ass" | |
ffmpeg -i "$1" -vf ass="$file.ass" -vcodec libx264 -acodec ac3 -ab 160k "$file.mp4" | |
rm "$file.ass" | |
else | |
echo ".str file and video file should have the same name" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my-proxy() { | |
sudo networksetup -setsocksfirewallproxystate Wi-Fi on | |
sudo networksetup -setsocksfirewallproxy Wi-Fi localhost 8001 | |
ssh cbecker -C -N -D 8001 # change your ssh info here | |
sudo networksetup -setsocksfirewallproxystate Wi-Fi off | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
radio() { | |
local radio | |
local station | |
local playlist | |
if test $# -eq 2; then | |
radio="$1" | |
station="$2" | |
elif test $# -eq 0; then | |
radio=soma |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global jQuery */ | |
/*jslint browser: true */ | |
(function (win, $) { | |
'use strict'; | |
// helpers | |
var Util, Globals; |
OlderNewer