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
| <script type="text/javascript"> | |
| $(function() { | |
| $('#click').click(function() { | |
| // do something | |
| // like... | |
| alert('Hi Guys!'); | |
| }); | |
| }); | |
| </script> |
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 'nokogiri' | |
| require 'open-uri' | |
| FEED_URL = 'http://feeds.feedburner.com/simpledesktops' | |
| SAVE_DIR = '~/.simple_desktop/' | |
| SAVE_FILE = File.expand_path(File.join(SAVE_DIR, 'background.png')) | |
| urls = [].tap do |urls| | |
| Nokogiri::XML.parse(open(FEED_URL)).search('description').each do |desc| |
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
| alias gfi="git flow init" | |
| alias gff="git flow feature" | |
| alias gfr="git flow release" | |
| alias gfh="git flow hotfix" | |
| alias gfs="git flow support" |
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
| ## likes endpoint | |
| { | |
| "name": "Frank Sinatra", | |
| "category": "Musician/band", | |
| "id": "104029269634285", | |
| "created_time": "2011-03-09T01:01:58+0000" | |
| }, | |
| ## music endpoint |
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
| resources :users do | |
| collection do | |
| get :overview | |
| get :overview_by_school | |
| 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
| def gateway | |
| index = try(read_attribute(:gateway)) || 0 | |
| GATEWAY[index] | |
| 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
| resources :deals do | |
| collection do | |
| get :current # => maps to /deals/current as "current_deals_path" | |
| 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
| require 'httparty' | |
| module MaxMind | |
| class API | |
| attr_accessor :key | |
| end | |
| class Request | |
| include HTTParty | |
| base_uri 'http://geoip3.maxmind.com/' |
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
| <Directory "/var/www/app/current/public/"> | |
| Options -Indexes -MultiViews FollowSymlinks Includes | |
| AllowOverride All | |
| Order deny,allow | |
| AuthType basic | |
| AuthName "Password Required" | |
| AuthUserFile /var/www/app/conf/passwords |
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
| cameron:~/ $ cat wtf.php [10:04:30] | |
| <?php | |
| function return_bytes($val) { | |
| $val = trim($val); | |
| $last = strtolower($val[strlen($val)-1]); | |
| switch($last) { | |
| // The 'G' modifier is available since PHP 5.1.0 | |
| case 'g': | |
| $val *= 1024; | |
| case 'm': |