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
| #include <stdio.h> | |
| //usage cat javascript.js | minifier > javascript.mini.js | |
| int main(int argc, char const* argv[]) | |
| { | |
| int c; | |
| while ((c=getchar()) != EOF) { | |
| if (c!= '\n' && c!='\t' && c!='\r') | |
| putchar(c); | |
| } | |
| return 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
| #!/bin/sh | |
| BRANCHES=`git branch` | |
| if [ $? != 0 ]; then | |
| exit | |
| fi | |
| GIT_SVN=0 | |
| git branch -r | grep 'git-svn' > /dev/null | |
| if [ $? = 0 ]; then | |
| GIT_SVN=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
| def get_input | |
| print ">>" | |
| STDOUT.flush | |
| response = STDIN.gets.chomp | |
| case response | |
| when "exit" | |
| puts "bye!" | |
| @running = false | |
| when "time" | |
| puts "The Time is:#{Time.now}" |
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
| Proc.new { |env| | |
| status, headers, body = | |
| begin | |
| @app.call(env) | |
| rescue => boom | |
| raise | |
| end | |
| [status, headers, body] | |
| } |
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
| " freakin sweet iterpolation | |
| let g:surround_{char2nr("#")} = "#{\r}" |
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
| aasm_column :state | |
| aasm_initial_state :division_selection | |
| aasm_state :division_selection | |
| aasm_state :track_selection | |
| aasm_state :track_selected | |
| aasm_event :select_division do | |
| transitions :to => :track_selection, :from => [ :division_selection ] | |
| 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
| render :xml => Twilio::Verb.new { |v| | |
| v.gather(:numDigits => 1, :timeout => 5, :action => recording_script_notification_url(@notification)) do | |
| v.play @notification.voicemessage_url | |
| v.say "If you would like to record again, press one, otherwise stay on the line" | |
| end | |
| v.say "Your notification is being sent" | |
| v.redirect send_notification_notification_url(@notification) | |
| }.response |
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 'gosu' | |
| include Gosu | |
| class MouseInfo < Window | |
| CENTER = 640/2 | |
| BOTTOM = 480 | |
| def initialize | |
| super(640, 480, false) | |
| @clicked = "" |
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 'gosu' | |
| include Gosu | |
| class MouseInfo < Window | |
| CENTER = 640/2 | |
| BOTTOM = 480 | |
| def initialize | |
| super(640, 480, false) | |
| @clicked = "" |
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
| // usage: $("#element").copyFields("#to", "#from") | |
| (function($) { | |
| $.fn.copyFields = function(to, from) { | |
| // find all the inputs in to | |
| var to = $(to + " input"); | |
| // find all the inputs in from | |
| var from = $(from + " input"); | |
| // when you click on the element | |
| $(this).click(function() { | |
| //loop through all the from inputs and put the value in the to input... |