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
namespace :db do | |
desc "abort rake if using bad memory techniques" | |
task :safety_migrate => :environment do | |
path = "#{RAILS_ROOT}/db/migrate/" | |
migration_directory = Dir.new(path) | |
proceed = true | |
migration_directory.each do |file| | |
if file != "." and file != ".." | |
migration = File.open("#{path}#{file}") | |
text = migration.read |
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
# If you work with git, you've probably had that nagging sensation of not knowing what branch you are on. Worry no longer! | |
export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ " | |
# This will change your prompt to display not only your working directory but also your current git branch, if you have one. Pretty nifty! | |
# ~/code/web:beta_directory$ git checkout master | |
# Switched to branch "master" | |
# ~/code/web:master$ git checkout beta_directory | |
# Switched to branch "beta_directory" |
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 'open-uri' | |
# url dsl -- the ultimate url dsl! | |
# | |
# You just can't beat this: | |
# | |
# $ irb -r url_dsl | |
# >> include URLDSL | |
# => Object | |
# >> http://github.com/defunkt.json |
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
@danielbru | |
@dougaitken | |
@theiBlog | |
@mike_wilt | |
@duncanfreeman | |
@sanjay | |
@Michaelmontano | |
@GoKTGo | |
@colinake | |
@lessallan |
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
http://twitter.com/Stammy/status/7389918542 | |
http://cooktobang.com/ | |
http://www.cookingforengineers.com/ | |
http://www.bbc.co.uk/food | |
http://www.ehow.com/how_5800287_quit-eating-junk-food.html | |
http://www.betterthancereal.com/index.html | |
http://www.nursingschoolsearch.com/blog/2008/07/100-food-blogs-to-inspire-your-healthy-eating/ | |
http://justbento.com/ | |
http://justhungry.com/ |
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
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby | |
# - a browser with WebSocket support | |
# | |
# Usage: | |
# ruby redis_pubsub_demo.rb | |
# |
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
service :notifo do |data, payload| | |
subscribe_url = URI.parse('https://api.notifo.com/v1/subscribe_user') | |
data['subscribers'].gsub(/\s/, '').split(',').each do |subscriber| | |
req = Net::HTTP::Post.new(subscribe_url.path) | |
req.basic_auth('github', secrets['notifo']['apikey']) | |
req.set_form_data('username' => subscriber) | |
net = Net::HTTP.new(subscribe_url.host, 443) | |
net.use_ssl = true | |
net.verify_mode = OpenSSL::SSL::VERIFY_NONE |
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
<?php | |
function notifo_message($title,$msg,$uri = false,$to = false) | |
{ | |
$notifo_pass = get_option('notifo_api_key'); | |
$notifo_user = get_option('notifo_username'); | |
$data = array('label' => get_bloginfo('name'), 'title' => $title, 'msg' => $msg); | |
if($uri) | |
{ |
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 sendNotifo(msg,title,uri,label) { | |
var https = new XMLHttpRequest(); | |
var auth = "Basic " + Base64.encode(localStorage.notifo_username+':'+localStorage.notifo_apisecret); | |
var push = 'to=' + encodeURIComponent(localStorage.notifo_username) + '&msg=' + encodeURIComponent(msg) + '&uri=' + encodeURIComponent(uri) + '&label=' + encodeURIComponent(label)+ '&title=' + encodeURIComponent(title); | |
https.open('POST', 'https://api.notifo.com/v1/send_notification', true); | |
https.setRequestHeader('Authorization', auth); | |
https.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); | |
https.send(push); | |
} |
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
.box-gradient { | |
background-image: -moz-linear-gradient(top, #444444, #999999); | |
background-image: -webkit-gradient(linear,left bottom,left top,color-stop(0, #444444),color-stop(1, #999999)); | |
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#444444', endColorstr='#999999'); | |
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#444444', endColorstr='#999999')"; | |
} | |
.ff2 .box-gradient, .ff3 .box-gradient, .opera .box-gradient { | |
background-image: url("../images/gradient.svg"); | |
} |