Skip to content

Instantly share code, notes, and snippets.

@jaredly
jaredly / .bash_profile
Last active September 27, 2018 22:24
my git config
# Super often, these are muscle memory
alias g=git
alias gs="git status"
alias gb="git b"
alias gd="git diff"
# See the git aliases section, but this is "git branch" but better
# (sorted by most recent, and other things)
alias gr="git r"
# Used as `gitca "commit message"` and it's done
@jaredly
jaredly / Europe.svg
Created September 19, 2018 02:07
Europe
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jaredly
jaredly / App.re
Last active January 1, 2021 17:34
ReasonReact Context API Example
module StringContext =
Context.MakePair({
type t = string;
let defaultValue = "Awesome";
});
let component = ReasonReact.statelessComponent("Tree");
let make = _children => {
@jaredly
jaredly / BasicServer.re
Created January 2, 2018 05:24
Simple Static File Server in Reason/OCaml
let recv = (client, maxlen) => {
let bytes = Bytes.create(maxlen);
let len = Unix.recv(client, bytes, 0, maxlen, []);
Bytes.sub_string(bytes, 0, len)
};
let parse_top = top => {
let parts = Str.split(Str.regexp("[ \t]+"), top);
switch (parts) {
// @flow
import {Component, type Node} from 'react'
import authenticatedApolloClient from '../shared/authenticatedApolloClient';
/**
* Example usage:
*
* const ScreenWithLoader = (props) => <ApolloWrapper
* queryOptions={{
let module Styled = {
let module Create (Config: {
let name: string;
let style: ReactNative.Style.style;
}) => {
let component = ReasonReact.statelessComponent Config.name;
let make ::paddingVertical=? => {
let style = combineStylesSomeHow Config.style paddingVertical; /* <- this is an optional btw */
View.make ::style
/* Template for proposals to update the syntax. Base template: https://gist.github.com/jordwalke/6935739b74eb9b8496670cc7860f5acf */
let a = 10;
let b = 20;
/* A */
let nonNamed = (a, b) => a + b;
type nonNamed = (int, int) => int;
@jaredly
jaredly / index.html
Last active December 16, 2016 01:47
<html>
<head>
<title>onpaste</title>
</head>
<body>
<div id="root"></div>
<script>
const log = txt => {
const div = document.createElement('div')
document.body.appendChild(div)
#!/usr/bin/env python
# Toss this in your ~/bin/ as ~/bin/reboost and `chmod +x ~/bin/reboost`
"""\
Usage:
reboost [cmd]
Commands:
first - follow upstream until just before master
last - follow downstreams all the way
up - go to parent
@jaredly
jaredly / about.md
Last active September 22, 2016 17:54
Git Tree commands

Here's part of my ~/.gitconfig.global

[user]
	name = Jared Forsyth
...
[alias]
    # View the tree!
    tree = log --oneline --decorate --all --graph
    tr = log --oneline --decorate --all --graph
 t = log --color --date-order --graph --oneline --decorate --simplify-by-decoration --branches