- base64_fixed_point.rb https://gist.github.com/epitron/4736881
- enum_weave.rb https://gist.github.com/epitron/a1807e9148d901e4cdd8
- webfile.rb https://gist.github.com/epitron/92bf23bfceaf07e5da66
- binding-addition.rb https://gist.github.com/epitron/6015603
- tweet-anagrams.rb https://gist.github.com/epitron/6479184
- epitest.rb https://gist.github.com/epitron/6628722
- rle.rb https://gist.github.com/epitron/7758166
- binary_rle.rb https://gist.github.com/epitron/897535
- proxy_controller.rb https://gist.github.com/epitron/7758166
- nokogiri_walk_tree.rb https://gist.github.com/epitron/10033479
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
| @[Link("mruby")] | |
| lib MRuby | |
| type MRubyState = Void* | |
| fun open = mrb_open : MRubyState | |
| fun load_string = mrb_load_string(mrb : MRubyState, code : Pointer(UInt8)) | |
| fun close = mrb_close(mrb : MRubyState) | |
| end | |
| CODE = <<-RUBY_CODE |
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
| /* bling.js */ | |
| window.$ = document.querySelector.bind(document); | |
| window.$$ = document.querySelectorAll.bind(document); | |
| Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); }; | |
| NodeList.prototype.__proto__ = Array.prototype; | |
| NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); }; |
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
| * { | |
| font-size: 12pt; | |
| font-family: monospace; | |
| font-weight: normal; | |
| font-style: normal; | |
| text-decoration: none; | |
| color: black; | |
| cursor: default; | |
| } |
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 Roshambo | |
| OPTIONS = [:rock, :paper, :scissors] | |
| WINNERS = OPTIONS.rotate.zip(OPTIONS).to_h | |
| LOSERS = WINNERS.invert | |
| attr_reader :value | |
| include Comparable | |
| def initialize value = OPTIONS.sample |
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 Proc | |
| class << self | |
| def compose *others | |
| others.map(&:to_proc).inject :* | |
| end | |
| end | |
| def * other | |
| proc { |*args| other.call self.call *args } | |
| 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 'matrix' | |
| def fib n | |
| matrix = Matrix[[0, 1], [1, 1]] ** n.pred | |
| matrix[1, 1].to_i | |
| end | |
| require 'minitest/autorun' | |
| require 'minitest/pride' |
2015-01-29 Unofficial Relay FAQ
Compilation of questions and answers about Relay from React.js Conf.
Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.
Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).
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 idc; // Internet delay chat! Yay! | |
| import tools.fixed_socket, tools.base; | |
| import tools.log, tools.threads, tools.threadpool; | |
| import tools.time; | |
| import readback; | |
| string download(string url, bool first = false) { | |
| if (url.find("://") == -1) url = "http://"~url; |
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/python3 | |
| import sys; | |
| from lxml import etree; | |
| def clean(f): | |
| print("Processing "+f+"...") | |
| tree = etree.parse(f) | |
| root = tree.getroot() | |
| used_actions=[] |