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 | |
// Pull from the db the list of channel names | |
$channels = array('music-for-japan-2011', '6819043', 'chelupa'); | |
function live_channels($channels) | |
{ | |
$live_channels = array(); | |
$channels_string = implode(';', $channels); | |
$url = 'http://api.ustream.tv/php/channel/'.$channels_string.'/getinfo'; | |
$ch = curl_init(); |
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
From fbd588741117556fd6f1b2ea59ebde87f39d72dc Mon Sep 17 00:00:00 2001 | |
From: Gray Manley <[email protected]> | |
Date: Mon, 30 May 2011 21:04:20 -0500 | |
Subject: [PATCH] index on master: db87927 Add check for duplicate short url | |
key. | |
--- | |
app.rb | 10 ++++++- | |
lib/pagination_helper.rb | 43 +++++++++++++++++++++++++++ | |
public/css/main.css | 73 ++++++++++++++++++++++++++++++++++++++++++++++ |
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 IPGallery | |
class LegacyCategory | |
include DataMapper::Resource | |
storage_names[:default] = "gallery_categories" | |
has n, :albums, 'LegacyAlbum', child_key: [:category_id] | |
has n, :images, 'LegacyImage' | |
has n, :child_categories, self.name, child_key: [:parent] |
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
rvm use 1.9.3@rails_backbone_example --create | |
gem install rails | |
rails new rails_backbone_test --skip-bundle | |
cd rails_backbone_test | |
Add `gem 'rails-backbone'` to Gemfile | |
bundle | |
rails g backbone:install | |
rails g scaffold Post title:string content:string | |
rails g backbone:scaffold Post title:string content:string | |
rake db:migrate |
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
# Various notes relating to my switch vim | |
ctrl-o in insert mode to switches you to normal mode for one command | |
then back to insert mode. | |
Key Movement | |
h Left | |
l Right | |
k Up a line |
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
# encoding: UTF-8 | |
# requires ruby 1.9.3 and up | |
# gem install nokogiri typhoeus | |
require 'nokogiri' | |
require 'typhoeus' | |
module Imgur | |
class AlbumDownloader |
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
#(^|\s|\)|\(|\{|\}|>|\]|\[|href=\S)((http|https|news|ftp)://(?:[^<>\)\[\"\s]+|[a-zA-Z0-9/\._\-!&\#;,%\+\?:=]+))(</a>)?# | |
#(^|\s|\)|\(|\{|\}|>|\]|\[|href=\S)(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))(</a>)?# |
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
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.memcached.plist | |
rm -f ~/Library/LaunchAgents/homebrew.mxcl.memcached.plist | |
brew uninstall memcached | |
brew install https://raw.github.com/gist/2421766/1a210dbd360486631ff4fb22fd74a0eed5983d91/memcached.rb | |
cp /usr/local/Cellar/memcached/1.4.13/homebrew.mxcl.memcached.plist ~/Library/LaunchAgents/ | |
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.memcached.plist | |
tail -f /usr/local/var/log/memcached.log |
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
class MatchData | |
def to_hash | |
Hash[[names, captures].transpose] | |
end | |
alias :to_h :to_hash | |
end |
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
function mkrvmrc () { | |
latest_ruby="$(rvm list strings | tail -n -1)" | |
echo "rvm $latest_ruby@$(basename $PWD) --create" > .rvmrc | |
source .rvmrc | |
} |