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
| .DS_Store | |
| tmp/ |
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
| # blog post: http://blog.slashpoundbang.com/post/3385815540/how-to-generate-an-opml-file-with-ruby | |
| require 'open-uri' | |
| require 'builder' | |
| require 'truffle-hog' | |
| require 'nokogiri' | |
| # CHANGE ME | |
| urls = %w(http://example.com/ http://example.org/) |
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
| # Add the gem | |
| gem 'rails_admin' |
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 'spec_helper' | |
| describe Users::OauthCallbacksController, "handle facebook authentication callback" do | |
| describe "#annonymous user" do | |
| context "when facebook email doesn't exist in the system" do | |
| before(:each) do | |
| stub_env_for_omniauth | |
| get :facebook |
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
| Request rate: 178.3 req/s (5.6 ms/req) | |
| Request size [B]: 78.0 | |
| Reply rate [replies/s]: min 178.0 avg 178.0 max 178.0 stddev 0.0 (1 samples) | |
| Reply time [ms]: response 5.6 transfer 0.0 | |
| Reply size [B]: header 126.0 content 167.0 footer 0.0 (total 293.0) | |
| Reply status: 1xx=0 2xx=1000 3xx=0 4xx=0 5xx=0 | |
| CPU time [s]: user 0.92 system 4.66 (user 16.4% system 83.1% total 99.6%) | |
| Net I/O: 64.6 KB/s (0.5*10^6 bps) |
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 'yaml' | |
| require 'fileutils' | |
| module Jekyll | |
| module Webby | |
| def self.process(webby_data_dir) | |
| raise ArgumentError, "webby dir #{webby_data_dir} not found" unless File.directory?(webby_data_dir) | |
| posts = 0 | |
| Dir["#{webby_data_dir}/**/*.txt"].each do |f| |
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
| // # getScript() | |
| // more or less stolen from jquery core and adapted by paul irish | |
| function getScript(url,success) { | |
| var head = document.getElementsByTagName("head")[0], done = false; | |
| var script = document.createElement("script"); | |
| script.src = url; | |
| // Attach handlers for all browsers | |
| script.onload = script.onreadystatechange = function(){ | |
| if (!done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") ) { |
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
| # create pg user | |
| # rm -Rf railsm; rails new turfobet -m ~/Dropbox/rails_templates/bootstrap.rb -d postgresql --skip-bundle --local | |
| add_source :gemcutter | |
| gsub_file('Gemfile', "source 'https://rubygems.org'", "") | |
| gem 'pg' | |
| gem "haml-rails" | |
| gem "simple_form" | |
| gem 'font-awesome-rails' | |
| gem 'remotipart', '~> 1.0' |
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 'active_record' | |
| require 'yaml' | |
| require 'logger' | |
| require 'fileutils' | |
| require 'aws/s3' | |
| ROOT = File.expand_path(File.dirname(__FILE__)) | |
| CONFIG = YAML.load_file(File.join(ROOT, "config", "database.yml")) | |
| TMP_BACKUP = File.join(ROOT, "tmp", "backup") |
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 'sinatra' | |
| conns = [] | |
| get '/' do | |
| erb :index | |
| end | |
| get '/subscribe' do | |
| content_type 'text/event-stream' |