This file contains hidden or 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
load 'deploy' if respond_to?(:namespace) # cap2 differentiator | |
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) } | |
load 'config/deploy' # remove this line to skip loading any of the default tasks |
This file contains hidden or 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/sh | |
# Usage: license | |
# Prints an MIT license appropriate for totin' around. | |
# | |
# $ license > MIT-LICENSE | |
set -e | |
echo "Copyright (c) `date +%Y` `git config --global user.name`" | |
echo ' | |
Permission is hereby granted, free of charge, to any person obtaining |
This file contains hidden or 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 name="viewport" content="initial-scale=1.0, user-scalable=no" /> | |
<style type="text/css"> | |
html { height: 100% } | |
body { height: 100%; margin: 0px; padding: 0px } | |
#map_canvas { height: 600px; width: 800px; } | |
.hidden { display: none; } | |
</style> |
This file contains hidden or 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 | |
/** | |
* Simple twitter stream function | |
* | |
* Usage: $tweets = userTimeline("hecticjeff"); | |
*/ | |
function userTimeline($screenName) | |
{ | |
// Create a remote connection | |
$twitter = curl_init("http://api.twitter.com/1/statuses/user_timeline.json?screen_name={$screenName}"); |
This file contains hidden or 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 'rubygems' | |
require 'gollum/frontend/app' | |
Precious::App.set(:gollum_path, Dir.pwd) | |
run Precious::App |
This file contains hidden or 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/sh | |
# Get a website ready to deploy with git | |
REPO_HOST='example.com' | |
REPO_PATH=$HOME/repos | |
# Check that the user has provided a directory to use and it exists | |
if [ ! "$1" ]; then | |
echo "Usage: $0 DIRECTORY" | |
echo "Where DIRECTORY is the folder that you want to contain the working copy" |
This file contains hidden or 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 hidden or 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
[/Users/chris/Code/Ruby/gist-550144 (master)] ruby-1.9.2-p0 | |
$ time php php_string.php > /dev/null | |
real 0m0.237s | |
user 0m0.218s | |
sys 0m0.017s | |
[/Users/chris/Code/Ruby/gist-550144 (master)] ruby-1.9.2-p0 | |
$ time php php_array.php > /dev/null | |
real 0m0.249s |
This file contains hidden or 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.onload = function () { | |
if (! document.querySelectorAll) { // Quick & Dirty way to tell the good browsers from the bad ones. | |
alert("Please upgrade your browser to view this site."); | |
} | |
}; |
This file contains hidden or 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
module Idea | |
class Generator | |
def actions | |
@actions ||= %w{read write design contemplate} | |
end | |
def objects | |
@objects ||= ['code', 'books', 'art', 'poetry', 'blogs'] | |
end | |