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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <style> | |
| * { | |
| box-sizing: border-box; | |
| } | |
| 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
| CREATE SEQUENCE sync_id; | |
| CREATE FUNCTION bump_sync_id() RETURNS trigger AS $$ | |
| begin | |
| NEW.sync_id := nextval('sync_id'); | |
| RETURN NEW; | |
| END; | |
| $$ LANGUAGE PLPGSQL; | |
| CREATE TABLE dogs (id SERIAL, name VARCHAR NOT NULL, sync_id INTEGER NOT NULL); |
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 python | |
| import time | |
| import random | |
| import optparse | |
| import dynamixel | |
| if __name__ == "__main__": | |
| parser = optparse.OptionParser() | |
| parser.add_option("-p", "--port", help="Serial port", default="/dev/tty.usbserial-A9ITPZVR") |
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 python | |
| import sys | |
| import time | |
| import optparse | |
| import dynamixel | |
| if __name__ == "__main__": | |
| parser = optparse.OptionParser() | |
| parser.add_option("-p", "--port", help="Serial port", default="/dev/tty.usbserial-A9ITPZVR") |
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 python | |
| import time | |
| import optparse | |
| import dynamixel | |
| if __name__ == "__main__": | |
| parser = optparse.OptionParser() | |
| parser.add_option("-p", "--port", help="Serial port", default="/dev/tty.usbserial-A9ITPZVR") | |
| parser.add_option("-b", "--baud", help="Baud rate", default="1000000") |
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 "sinatra" | |
| gem "sinatra-contrib" | |
| gem "sequel" | |
| gem "sqlite3" | |
| gem "multi_json" | |
| group :development do | |
| gem "shotgun" |
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
| 1.9.3-p194 |
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
| FakeWeb.register_uri(:any, %r{^http://(.+?):9200/}, :body=>"", :status=>500) |
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 call_spy | |
| calls = [] | |
| depth = 0 | |
| set_trace_func proc { |event, file, line, id, binding, classname| | |
| if id != :set_trace_func | |
| if (event == "c-call" || event == "call") | |
| indent = " " * (depth * 2) | |
| calls << "#{indent}#{classname}##{id}" | |
| depth += 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
| Log in and visit: | |
| https://github.com/settings/payments | |
| Then in the console: | |
| $("table#payment-history tr.success td.amount").toArray().reduce(function(a, b) { | |
| var dollars = b.innerHTML.replace(/[^\d\.]/g, ""); | |
| return a + parseFloat(dollars); | |
| }, 0); |