Skip to content

Instantly share code, notes, and snippets.

View btipling's full-sized avatar
:shipit:
shipping code

btipling

:shipit:
shipping code
  • ConductorOne
  • Bay Area, California
  • 06:28 (UTC -12:00)
View GitHub Profile
module Main where
import Control.Monad.Writer
main :: IO ()
main = do
putStrLn $ "do notation: " ++ (show $ runWriter multWithLog)
putStrLn $ "binding: " ++ (show $ runWriter multiWithLogBind)
putStrLn $ "let and bind: " ++ (show $ runWriter multiWithLogLet)
@btipling
btipling / Main.hs
Last active June 25, 2017 23:57
Haskell based parenthesis validator
{-|
Module: Validator
Description: Parses parenthesis variations for correct nesting.
Parses (), <>, {}, [] etc for correct nesting, open and closing.
Usage:
$ validator '[<>{()}]'
[<>{()}]
~/p/r/fe (master) $ fe mrs
./src/main.rs
~/p/r/fe (master) $ fe srcmain
./src/main.rs
~/p/r/fe (master) $ fe Catom
./Cargo.toml
~/p/r/fe (master) $ fe .rs

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

fn main() {
hello_world();
fizz_buzz();
reverse_string("The quick red fox jumped over the lazy brown dog!");
}
fn hello_world() {
println!("Hello, world!");
indexes: [
{
using: 'GIN',
fields: ['field']
}
]
// CREATE INDEX field ON $modelTable USING gin (field);
indexes: [
#!/usr/bin/env sh
SPATH="$(cd $(dirname "$0") && pwd -P)"
SECRET_NAME=${1:-docker-registry-secret}
CONFIG_PATH=${2:-$SPATH/localkube.json}
if [[ ! -f $CONFIG_PATH ]]; then
echo "Unable to locate service account config JSON: $CONFIG_PATH";
exit 1;
fi
func lookAt(cameraPosition: float4, cameraRotation: float4) -> float4x4 {
let initialUp = float4(0.0, 1.0, 0.0, 1.0)
var poiFromOrigin = float4(cameraPosition.x, cameraPosition.y, cameraPosition.z + 1000.0, 1.0)
let cameraRotationMatrix = getRotationMatrix(rotationVector: cameraRotation)
let eye = float3(cameraPosition.x, cameraPosition.y, cameraPosition.z)
@btipling
btipling / 2d-rotation-matrix.markdown
Created October 15, 2016 06:24
2D Rotation matrix

2D Rotation matrix

Click in two different locations in the white box to draw a line with a direction. Click a third time to place a third arbitrary point. The code will then use the generalized line equation (ax + by + c) to determine the side of the line the 3rd point is on. It draws a line orthogonal to the initial line. If this new line is red the third dot is opposite of this new line, if it's green it's on the same side.

Todo: Get distance to line from point and find the closest place on the line to the third point.

A Pen by swartkrans on CodePen.

License.