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
| <html> | |
| <head> | |
| <title>Total tweets</title> | |
| <style type="text/css"> | |
| /* | |
| input { | |
| float: left; | |
| clear: both; | |
| } | |
| */ |
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
| jQuery(window).bind('orientationchange', function(e) { | |
| switch ( window.orientation ) { | |
| case 0: | |
| alert('portrait mode'); | |
| break; | |
| case 90: | |
| alert('landscape mode screen turned to the left'); |
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
| if (window.console && window.console.profile) { | |
| console.profile("label for profile"); | |
| // insert code to profile here, | |
| // all function calls will be profiled | |
| console.profileEnd(); | |
| } |
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
| #Save in lib/taks/emulator.rake | |
| #after run rake emulate:mobile | |
| require 'rubygems' | |
| require 'active_support' | |
| require 'logger' | |
| namespace :emulate do | |
| desc "Emulate realtime votes for mobile poll view" |
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
| desc 'Pretty print out all defined routes in match order, with names. Target specific controller with CONTROLLER=x.' | |
| task :pretty_routes => :environment do | |
| all_routes = ENV['CONTROLLER'] ? Fanhub::Application.routes.select { |route| route.defaults[:controller] == ENV['CONTROLLER'] } : Fanhub::Application.routes | |
| routes = all_routes.routes.collect do |route| | |
| reqs = route.requirements.empty? ? "" : route.requirements.inspect | |
| {:name => route.name, :verb => route.verb, :path => route.path, :reqs => reqs} | |
| end | |
| File.open(File.join(Rails.root, "routes.html"), "w") do |f| | |
| f.puts "<html><head><title>Rails 3 Routes</title></head><body><table border=1>" | |
| f.puts "<tr><th>Name</th><th>Verb</th><th>Path</th><th>Requirements</th></tr>" |
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.protocol}#{request.host_with_port}#{request.fullpath} |
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
| ############################################################# | |
| # FUCK | |
| # Listen and write some poetry | |
| ############################################################# | |
| begin | |
| File.open("http://www.youtube.com/watch?v=goeOUTRy2es&list=RD02KpOtuoHL45Y") | |
| rescue SetFocusError | |
| 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
| // curl -X POST -d url="http://www.orangelt.us/info/wp-content/uploads/2010/08/OrangeLT_White_Background.jpg" // https://www.filepicker.io/api/store/S3?key=KEY | |
| var filepicker_url = "https://www.filepicker.io/api/store/S3?key=KEY" | |
| var images = [ | |
| "http://www.orangelt.us/info/wp-content/uploads/2010/08/OrangeLT_White_Background.jpg", | |
| "http://www.aussieapples.com.au/media/images/galleries/apple-photo-gallery/pink_lady_apple.jpg" | |
| ]; | |
| $.each(images, function(k, v) { |
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 filepicker_url = "https://www.filepicker.io/api/store/S3?key=KEY" | |
| var images = [ | |
| "http://www.orangelt.us/info/wp-content/uploads/2010/08/OrangeLT_White_Background.jpg", | |
| "http://www.aussieapples.com.au/media/images/galleries/apple-photo-gallery/pink_lady_apple.jpg" | |
| ]; | |
| $.each(images, function(k, v) { |
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 | |
| // A central reference to the root jQuery(document) | |
| rootjQuery, | |
| // The deferred used on DOM ready | |
| readyList, | |
| // Support: IE9 | |
| // For `typeof xmlNode.method` instead of `xmlNode.method !== undefined` | |
| core_strundefined = typeof undefined, |