Install Salt on macOS
Install Homebrew
Install Dependencies
brew install python swig zmq
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 << |
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), |
// 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" | |
}] |
#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 |
jit-toy: jit-toy.cpp | |
clang++ -g -o $@ $^ $(shell /usr/lib/llvm-5.0/bin/llvm-config --cxxflags --ldflags --system-libs --libs core) |
# 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 |
#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 |
brew install python swig zmq
enum FacResult { | |
Become(i32,i32), | |
Return(i32), | |
} | |
fn fac_tail(n: i32, accu: i32) -> FacResult { | |
if n < 2 { | |
// result known | |
FacResult::Return(accu) | |
} else { |
/* | |
* This implementation of popen3() was created in 2007 for an experimental | |
* mpg123 frontend and is based on a popen2() snippet found online. This | |
* implementation may behave in unexpected ways if stdin/stdout/stderr have | |
* been closed or modified. No warranty of its correctness, security, or | |
* usability is given. My modifications are released into the public domain, | |
* but if used in an open source application, attribution would be appreciated. | |
* | |
* Mike Bourgeous | |
* https://github.com/mike-bourgeous |