Skip to content

Instantly share code, notes, and snippets.

Jared Forsyth jaredly

Block or report user

Report or block jaredly

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:a5e0102c060b7a1b40525d41f87843a8
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
View template-function-syntax.re
/* 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;
View index.html
<html>
<head>
<title>onpaste</title>
</head>
<body>
<div id="root"></div>
<script>
const log = txt => {
const div = document.createElement('div')
document.body.appendChild(div)
View reboost
#!/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 Sep 22, 2016
Git Tree commands
View about.md

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
View resultUtils.swift
import * from PackTypes.Result
let module P = PackTypes.Parsing
let rec getChild = (children, mapper) => switch children {
case []: None
case [child ...rest]: switch mapper(child) {
case None: getChild(rest, mapper)
case x: x
}
}
let rec getChildren = (children, mapper) => switch children {
View error.ml
type something = | Something 'a :something;
module type ChildType = {let makeSomething: int => something;};
let module MakeThing (ChildA: ChildType) (ChildB: ChildType) => {
type childArg = | A int | B int;
let doThing arg =>
switch arg {
| A n => ChildA.makeSomething 10
| B n => ChildB.makeSomething 5
View ReactNativeComponent.swift
public class ReactNativeComponent: UIViewController {
let callbacks: [Int]
let properties: [String: AnyObject]
let name: String
init(name: String, properties: [String: AnyObject], callbacks: [Int]) {
self.name = name
self.properties = properties
self.callbacks = callbacks
View codemirror.cljs
(defn code-mirror
"Create a code-mirror editor. The parameters:
value-atom (reagent atom)
when this changes, the editor will update to reflect it.
options
:style (reagent style map)
will be applied to the container element
:js-cm-opts
options passed into the CodeMirror constructor
:on-cm-init (fn [cm] -> nil)
View Document.nm
{
"title": "Demobox",
"created": 1432725699439,
"opened": 1433371827400,
"repl": "null",
"root": {
"id": "bglg05h4fvzbftq2vnwpv3t1lbbb9pjm",
"created": 1432725699462,
"modified": 1432725699462,
"content": "Demobox",
You can’t perform that action at this time.