brew install python swig zmq
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> | |
| var module = WebAssembly.instantiateStreaming(fetch("linked_list.wasm"), {}); | |
| </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 "json" | |
| struct = { "a" => 1, "b" => 2, "c" => [1, 2, 3], "d" => [{ "e" => 3 }, nil, false, true, [], {}] } | |
| source = JSON.dump(struct) | |
| tokens = [] | |
| index = 0 | |
| until source.empty? | |
| tokens << |
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 'bundler/inline' | |
| gemfile do | |
| source 'https://rubygems.org' | |
| gem 'repeatable', "= 1.0.0" | |
| end | |
| weekdays = Repeatable::Expression::Union.new( | |
| Repeatable::Expression::Weekday.new(weekday: 1), | |
| Repeatable::Expression::Weekday.new(weekday: 2), |
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
| // https://oembed.com/providers.json | |
| [{ | |
| "provider_name": "23HQ", | |
| "provider_url": "http:\/\/www.23hq.com", | |
| "endpoints": [{ | |
| "schemes": [ | |
| "http:\/\/www.23hq.com\/*\/photo\/*" | |
| ], | |
| "url": "http:\/\/www.23hq.com\/23\/oembed" | |
| }] |
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
| #include <time.h> // Robert Nystrom | |
| #include <stdio.h> // @munificentbob | |
| #include <stdlib.h> // for Ginny | |
| #define r return // 2008-2019 | |
| #define l(a, b, c, d) for (i y=a;y\ | |
| <b; y++) for (int x = c; x < d; x++) | |
| typedef int i;const i H=40;const i W | |
| =80;i m[40][80];i g(i x){r rand()%x; | |
| }void cave(i s){i w=g(10)+5;i h=g(6) | |
| +3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u |
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
| jit-toy: jit-toy.cpp | |
| clang++ -g -o $@ $^ $(shell /usr/lib/llvm-5.0/bin/llvm-config --cxxflags --ldflags --system-libs --libs core) |
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
| # use ImageMagick convert | |
| # the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf | |
| convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf |
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
| #include <stdint.h> | |
| /** | |
| * Encode a code point using UTF-8 | |
| * | |
| * @author Ondřej Hruška <ondra@ondrovo.com> | |
| * @license MIT | |
| * | |
| * @param out - output buffer (min 5 characters), will be 0-terminated | |
| * @param utf - code point 0-0x10FFFF |
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
| enum FacResult { | |
| Become(i32,i32), | |
| Return(i32), | |
| } | |
| fn fac_tail(n: i32, accu: i32) -> FacResult { | |
| if n < 2 { | |
| // result known | |
| FacResult::Return(accu) | |
| } else { |
NewerOlder