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> | |
| <script src="./leaflet.js"></script> | |
| <script> | |
| window.onload = function() { | |
| var myCrs = L.Util.extend({}, L.CRS, { | |
| projection: L.Projection.LonLat, | |
| transformation: new L.Transformation(1, 0, 1, 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
| <html> | |
| <head> | |
| <script src="./leaflet.js"></script> | |
| <script> | |
| window.onload = function() { | |
| var map = new L.Map('map'); | |
| map.setView(new L.LatLng(0, 0), 0, true); | |
| var bounds = [ | |
| new L.LatLng(0, 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
| #!/usr/bin/env ruby | |
| dudes = {} | |
| i = 0 | |
| File.open('/tmp/clean.csv', 'w') do |fh| | |
| File.open('/Users/tjarratt/Desktop/smoking_azver.csv').readlines.each do |line| | |
| # implicitly take array of comma separated values, store them in temporary | |
| # values that you can work with and inspect |
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 'set' | |
| fruit = Set.new(['apple', 'banana']) | |
| fruit += ['apple'] # awesome | |
| # => ['apple', 'banana'] |
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 blastoff(n): | |
| if n <= 0: | |
| print 'BLASTOFF' | |
| return | |
| else: | |
| print n | |
| blastoff(n - 1) | |
| def do_n(fn, n, *args): | |
| if n <= 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
| function rebasei { | |
| /usr/local/Cellar/elinks/0.11.7/bin/elinks -dump randomfunfacts.com | sed -n '/^| /p' | tr -d \|; | |
| git rebase --interactive "$@" | |
| } |
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 JSONServer < Sinatra::Base | |
| post "/endpoint" do | |
| notifications = JSON[request.body.read] | |
| notifications.each do |event| | |
| puts event.inspect | |
| end | |
| return 200 | |
| 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
| source 'https://rubygems.org' | |
| gem 'savon', :git => 'https://github.com/savonrb/savon' | |
| # until this is merged in, you can use my company's public fork | |
| gem 'savon-multipart', :git => 'https://github.com/nearbuy/savon-multipart' | |
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
| module Something | |
| def self.included(klass) | |
| klass.extend(ClassMethods) | |
| end | |
| module ClassMethods | |
| def something | |
| puts 'zomg' | |
| 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
| # input: N | |
| # foreach N | |
| # export name = $(git log --format=%B -n 1 HEAD | head -1 | sed -e 's/ /_/g) | |
| # git revert HEAD~1 | |
| # git stash save $name |
OlderNewer