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
/*jslint plusplus: true, continue: true */ | |
/*global define: false, alert: false */ | |
function trimString(str) { | |
'use strict'; | |
str = str.replace(/^\s\s*/, ''); | |
var ws = /\s/, | |
i = str.length; | |
while (ws.test(str.charAt(--i))); | |
return str.slice(0, i + 1); | |
} |
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
SELECT | |
* | |
FROM ( | |
SELECT | |
ROW_NUMBER() OVER (ORDER BY last_name asc) AS RowNum, | |
phppos_people.*, | |
phppos_employees.username, | |
phppos_employees.deleted | |
FROM phppos_people | |
JOIN phppos_employees ON |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
gi () { | |
local cmd=$1 | |
shift 1 | |
cmd=$(echo $cmd | sed -e 's/^t//') | |
git $cmd $@ | |
} |
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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use POSIX qw(setsid); | |
&daemonize; | |
exec("mplayer -really-quiet -noar /usr/share/sounds/gnome/default/alerts/glass.* &> /dev/null"); | |
sub daemonize { | |
chdir '/' or die "Can't chdir to /: $!"; |
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
#!/usr/bin/bash | |
git remote prune origin | |
git branch | grep -v master$ | cut -d' ' -f3 | while read b; do echo "$b == $(git branch -r | grep $b)"; done | grep '== $' | cut -d' ' -f1 | xargs -n1 git branch -d | |
git gc |
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
h = Hash.new do |h,k| | |
l = h.keys.select {|i| i < k}.max | |
h[l] | |
end | |
h[1] = :foo | |
h[5] = :bar | |
h[3] # => :foo |
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
#!/usr/bin/bash | |
ssh new.jroes.net 'cat /dev/null > ~/.the-ding && tail -f ~/.the-ding' | while read hit | |
do | |
mplayer -really-quiet -noar /usr/share/sounds/gnome/default/alerts/glass.* &> /dev/null | |
done |
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
require_relative './text_effect' | |
fonts = %w(Courier Helvetica Times-Roman Arial-Regular Consolas-Regular | |
Inconsolata-Medium Times-New-Roman-Regular Verdana-Regular) | |
effects = [:arc, :taper, :concave, :pinch, :bulge, :ramp, :wedge, :normal] | |
fonts.product(effects).each do |font, effect| | |
File.open("#{font}-#{effect}.svg", "w") do |f| | |
f.write TextEffect.new('Hello World!', font, effect) |
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
#!/usr/bin/bash | |
while read f | |
do | |
echo "$(git log --format="%at" --reverse "$f" | head -n1) --> $f" | |
done | sort -n |