Skip to content

Instantly share code, notes, and snippets.

View versioning.md

Versioning

This project uses $SOME_CUTE_VERSIONING_SCHEME_NAME. It works like this:

Version numbers have the short form:

<major>.<minor>

Stability

View antd-peer-deps.sh
#!/bin/bash
set -ex
repos='
animate
cascader
checkbox
collapse
dialog
@brandonbloom
brandonbloom / dev
Created Aug 27, 2020
Go: build & run command script
View dev
#!/bin/bash
set -e
if [ "$#" == "0" ]; then
echo "Usage: $0 <cmd> <args...>" > /dev/stderr
exit 1
fi
cmd=$1
View workers.js
let mutex = Promise.resolve();
let counter = 0;
const read = async () => counter;
const write = async (value) => {
counter = value;
}
View namespaced_methods.clj
(ns hr)
(defprotocol Employee
(fire [this]))
(ns war)
(defprotocol Missile
(fire [this]))
View rectangle.ruby
class Rectangle
include Model
attr_accessor :left, :right, :top, :bottom, :width
def computed_width
return unless left and right
right - left
end
View feed.rb
module Model
def initialize(attributes)
self.attributes = attributes
end
def attributes=(hash)
hash.each do |k, v|
send :"#{k}=", v
end
end
View jit.t
local C = terralib.includecstring [[
#include <stdio.h>
]]
function makeAdder(x)
print("makeAdder(" .. x .. ")")
return terra(y : int)
return x + y
end
end
View dispatch.cs
using System;
class Base
{
public virtual string Method()
{
return "base method";
}
}
View example.clj
;; manual
(def fuel (atom 10))
(loop []
(when (zero? (swap! fuel dec))
(fail "out of fuel!"))
(recur))