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
| root_dir = File.dirname(__FILE__) | |
| if !defined?(Sinatra) | |
| $:.unshift "#{root_dir}/vendor/sinatra/lib" if File.directory?("#{root_dir}/vendor/sinatra") | |
| end | |
| require 'rubygems' | |
| require 'sinatra' | |
| Sinatra::Application.default_options.merge!( |
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
| // testing serving javascript from a gist | |
| alert("hello world"); |
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
| // ==UserScript== | |
| // @name Outlook Web Access Extensions | |
| // @namespace http://www2.hawaii.edu/~dburger | |
| // @description Extensions to using the bastard child Outlook Web Access | |
| // @include https://mail.camber.com/exchange/* | |
| // ==/UserScript== | |
| ( | |
| function() { |
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
| def form_auth_token | |
| (protect_against_forgery?) ? form_authenticity_token : '' | |
| 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
| <%= javascript_tag "var FORM_AUTH_TOKEN = '#{form_auth_token}';" %> |
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
| new Ajax.Request(url, {parameters: 'authenticity_token=' + FORM_AUTH_TOKEN}); |
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
| var store = new Ext.data.Store({ | |
| baseParams: { | |
| authenticity_token: FORM_AUTH_TOKEN | |
| }, | |
| ... |
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 MondoController < ApplicationController | |
| protect_from_forgery :except => [:action_one, :action_two] | |
| # ... |
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
| namespace :minifier do | |
| def minify(files) | |
| files.each do |file| | |
| cmd = "java -jar lib/yuicompressor-2.3.1.jar #{file} -o #{file}" | |
| puts cmd | |
| ret = system(cmd) | |
| raise "Minification failed for #{file}" if !ret | |
| end | |
| 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
| task :after_update_code, :roles => :app do | |
| run "cd #{release_path} && rake minifier:minify" if rails_env == :production | |
| end |
OlderNewer