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($) { | |
return $.fn.konami = function(callback, code) { | |
if (code == null) { | |
code = "38,38,40,40,37,39,37,39,66,65"; | |
} | |
return this.each(function() { | |
var kkeys; | |
kkeys = []; | |
return $(this).bind('keydown', function(e) { | |
kkeys.push(e.keyCode); |
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
window.onbeforeunload = function () { | |
var shouldConfirmClose = ($('.playing').length > 0); //get boolen value | |
if (shouldConfirmClose) { | |
//this will alert user | |
return 'Are you sure?'; | |
} | |
else { | |
//this wont | |
window.onbeforeunload = undefined; | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" content="text/html" http-equiv="content-type"> | |
<title>Diaspora Pods by Country</title> | |
<script src="http://www.ammap.com/lib/ammap.js" type="text/javascript"></script> | |
<script src="http://www.ammap.com/lib/maps/js/worldLow.js" type="text/javascript"></script> | |
<script> | |
var map; | |
AmCharts.ready(function() { |
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
git_joined_committers_caption() { | |
authors=`git log --no-merges --format='%aN' | sort -u` | |
OLD_IFS=$IFS | |
IFS=$(echo -en "\n\b") | |
author_list="" | |
for author in $authors; do | |
author_first_commit=`git log --author="${author}" --pretty=format:%H|tail -1` | |
author_list+="$(git log -1 --format='%ct|%an started comitting' $author_first_commit)\n" | |
done | |
IFS=$OLD_IFS |
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
class PHPHandler | |
def call(template) | |
php = `echo "#{template.source}" | php`.html_safe.inspect | |
end | |
end | |
ActionView::Template.register_template_handler(:php, PHPHandler.new) |
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
#! /bin/bash | |
START_DIR=$PWD | |
DIASPORA_DIR="/var/vhosts/diaspora.digitalignition.net/diaspora" | |
DEFAULT_BRANCH="develop" | |
UNICORN_EXEC="service unicorn" | |
UNICORN_CONF="/etc/unicorn/diaspora.conf" | |
RAILS_ENV="production" | |
function diaspora_unicorn_service() { | |
if [ $# -lt 1 ]; then |
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
20:29:15 T:139663440447360 NOTICE: ----------------------------------------------------------------------- | |
20:29:15 T:139663440447360 NOTICE: Starting XBMC (12.0 Git:ae08a23), Platform: Linux (Ubuntu 12.04.2 LTS, 3.2.0-36-generic x86_64). Built on Jan 29 2013 | |
20:29:15 T:139663440447360 NOTICE: special://xbmc/ is mapped to: /usr/share/xbmc | |
20:29:15 T:139663440447360 NOTICE: special://xbmcbin/ is mapped to: /usr/lib/xbmc | |
20:29:15 T:139663440447360 NOTICE: special://masterprofile/ is mapped to: /home/ruxton/.xbmc/userdata | |
20:29:15 T:139663440447360 NOTICE: special://home/ is mapped to: /home/ruxton/.xbmc | |
20:29:15 T:139663440447360 NOTICE: special://temp/ is mapped to: /home/ruxton/.xbmc/temp | |
20:29:15 T:139663440447360 NOTICE: The executable running is: /usr/lib/xbmc/xbmc.bin | |
20:29:15 T:139663440447360 NOTICE: Local hostname: Rogue | |
20:29:15 T:139663440447360 NOTICE: Log File is located: /home/ruxton/.xbmc/temp/xbmc.log |
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
def name_of_the_drink ingredients | |
case ingredients | |
when 'cachaça + lime + ice + sugar' | |
return 'Caipirinha' | |
when 'cachaça + juice + sugar' | |
return 'Batida' | |
when 'cachaça + cashew' | |
return 'Caju Amigo' | |
when 'cachaça + water + sugar + orange||lime + cloves + cinnamon + ginger' | |
return 'Quentã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
## I have a member class, it has a method on it called facebook, you will also need the user_photos permission | |
# | |
# def facebook | |
# @facebook ||= Koala::Facebook::API.new facebook_auth.credentials.token if facebook? | |
# end | |
# | |
## | |
user=User.last |
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
# rc: Rails console | |
alias rc="rails c" | |
# debugme: touch tmp/debug.txt | |
alias debugme="touch tmp/debug.txt" | |
# rgm: Generate rails migrations | |
function rgm() { | |
local fileopener file |
NewerOlder