Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| #!/usr/bin/env bash | |
| git ls-files db/migrate/*.rb | sort | tail -1 | \ | |
| ruby -e "schema_version=STDIN.read[/\d+/]; init_schema=%(db/migrate/#{schema_version}_init_schema.rb); | |
| %x(git rm -f db/migrate/*.rb; | |
| mkdir db/migrate; | |
| git mv db/schema.rb #{init_schema}; | |
| rake db:migrate; | |
| git add db/schema.rb; git commit -m 'Squashed migrations')" |
| var mediaJSON = { "categories" : [ { "name" : "Movies", | |
| "videos" : [ | |
| { "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
| "sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
| "subtitle" : "By Blender Foundation", | |
| "thumb" : "images/BigBuckBunny.jpg", | |
| "title" : "Big Buck Bunny" | |
| }, | |
| { "description" : "The first Blender Open Movie from 2006", | |
| "sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |
| require 'koala' # gem install koala --no-document | |
| # create a facebook app and get access token from here | |
| # https://developers.facebook.com/tools/explorer | |
| # select "read_mailbox" when authenticating | |
| oauth_access_token = 'xxxxxxxxxxxxxxxxxxxxxx' | |
| graph = Koala::Facebook::API.new(oauth_access_token) | |
| # get all latest messages | |
| limit = 10 |
| // Just before switching jobs: | |
| // Add one of these. | |
| // Preferably into the same commit where you do a large merge. | |
| // | |
| // This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
| // and then it quickly escalated into more and more evil suggestions. | |
| // I've tried to capture interesting suggestions here. | |
| // | |
| // Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
| // @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| require 'faraday_middleware' | |
| require 'hashie/mash' | |
| # Public: GeoIP service using freegeoip.net | |
| # | |
| # See https://github.com/fiorix/freegeoip#readme | |
| # | |
| # Examples | |
| # | |
| # res = GeoipService.new.call '173.194.64.19' |
| $stack, $draws = [], {} | |
| def method_missing *args | |
| return if args[0][/^to_/] | |
| $stack << args.map { |a| a or $stack.pop } | |
| $draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :< | |
| end | |
| class Array | |
| def +@ |
| module Test | |
| module Unit | |
| TestCase = RSpec::Core::ExampleGroup | |
| end | |
| end | |
| class Test::Unit::TestCase | |
| def self.inherited(host) | |
| host.set_it_up host.name.gsub(/(Spec|Test)/,'') | |
| def host.method_added(name) |