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
# autoload concerns | |
module YourApp | |
class Application < Rails::Application | |
config.autoload_paths += %W( | |
#{config.root}/app/controllers/concerns | |
#{config.root}/app/models/concerns | |
) | |
end | |
end |
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> | |
<script src="https://raw.github.com/LearnBoost/Socket.IO/master/socket.io.js"></script> | |
<script src="https://raw.github.com/documentcloud/underscore/master/underscore.js"></script> | |
<script src="http://code.jquery.com/jquery-1.6.1.min.js"></script> | |
</head> | |
<body> | |
<form id="connect"> | |
Nick: <input type="text"> |
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 'term/ansicolor' | |
# yeilds a stacktrace for each SQL query | |
# put this file in config/initializers | |
class QueryTrace < ActiveSupport::LogSubscriber | |
include Term::ANSIColor | |
attr_accessor :trace_queries | |
def sql(event) #:nodoc: | |
return unless QueryTrace.enabled? && logger.debug? && Rails.env.development? |
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
module Jekyll | |
class Pagination < Generator | |
# This generator is safe from arbitrary code execution. | |
safe true | |
# Generate paginated pages if necessary. | |
# | |
# site - The Site. | |
# |
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
# normal Gem dependancy declarations | |
# ... | |
group :test, :cucumber do | |
gem 'pdf-reader' | |
end |
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
56k: "https://123.campfirenow.com/images/56k.gif" | |
bell: ":bell:" | |
bezos: ":laughing::thought_balloon:" | |
bueller: "anyone?" | |
butts: ":open_hands: :smoking:" | |
clowntown: "https://123.campfirenow.com/images/clowntown.gif" | |
cottoneyejoe: ":notes::hear_no_evil::notes:" | |
crickets: "hears crickets chirping" | |
dadgummit: "dad gummit!! :fishing_pole_and_fish:" | |
dangerzone: "https://123.campfirenow.com/images/dangerzone.png" |
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/env ruby | |
# Processor for Github flavored markdown, inspired by: | |
# https://github.com/alampros/Docter/blob/master/bin/github-flavored-markdown.rb | |
# | |
# Current version of this script can be found here: | |
# https://gist.github.com/1300939 | |
# | |
# Adapted for Redcarpet version 2 by Ralph von der Heyden | |
# http://github.com/ralph | |
# http://twitter.com/ralph |
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 | |
sqlite3 $1 .dump | sed -e '/sqlite_sequence/d' \ | |
-e '/PRAGMA/d' \ | |
-e '/BEGIN TRANSACTION/d' \ | |
-e '/COMMIT/d' \ | |
-e 's/"/`/g' |
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
# Requires the following gems: | |
# - prowler (v. 1.2) | |
# - gdata | |
# Also requires prowl on your iPhone | |
# As always: Feel free to use as is, I'm not responsible for anything | |
prowl_api_key = "" | |
fritz_box_host = "" | |
google = { | |
:user => "", |
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/env ruby | |
# List all keys stored in memcache. | |
# Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place. | |
require 'net/telnet' | |
headings = %w(id expires bytes cache_key) | |
rows = [] |