Skip to content

Instantly share code, notes, and snippets.

View nixterrimus's full-sized avatar
💭
End of line

[Gone] nixterrimus

💭
End of line
View GitHub Profile
import Foundation
enum DepthChange {
case same
case increasing
case decreasing
}
func window(array: Array<Int>, ofSize size: Int) -> [[Int]] {
(size...array.count).map { startingIndex in
import * as fs from "fs"
import * as path from "path"
import * as v from "./util/vector"
type OutputImage = {
width: number,
height: number,
maxColor: number
}
/*
## Expression Formatter
Build up an expression that can be formatted in a human way, for example:
"What is one plus two plus three plus four?"
"Answer: ten"
*/
indirect enum Expression {
case number(Int)
@nixterrimus
nixterrimus / PerseusParser.ne
Created October 8, 2018 18:34
Perseus Parser
@{%
const lexer = require("./lexer");
function flatten(arr) {
return arr.reduce(function (flat, toFlatten) {
return flat.concat(Array.isArray(toFlatten) ? flatten(toFlatten) : toFlatten);
}, []);
}
%}
@lexer lexer
@nixterrimus
nixterrimus / destination.jsx
Created February 20, 2018 17:02
Image Stretching
// @flow
import React, { Component } from "react";
import { Text, View, Image, StatusBar } from "react-native";
import { Navigation } from "react-native-navigation";
type Props = {
title: string,
fanartUrl: string,
description: string,
@nixterrimus
nixterrimus / Destination.js
Last active February 19, 2018 21:52
Custom Transition between scenes
// @flow
import React, { Component } from "react";
import { Text, View, Image } from "react-native";
import { Navigation } from "react-native-navigation";
type Props = {};
export default class extends Component<Props> {
render() {
return (
// Xcode 9 beta 4
import UIKit
import PlaygroundSupport
struct Book {
let id: Int
let title: String
let author: String
}
@nixterrimus
nixterrimus / WIP Recurring Bills.carbide.md
Last active January 2, 2017 00:17
WIP Recurring Bills

WIP Recurring Bills

@nixterrimus
nixterrimus / Advent of Code 2015: Day 1.carbide.md
Last active December 13, 2016 22:22
Advent of Code 2015: Day 1

Advent of Code 2015: Day 1

//: Playground - noun: a place where people can play
import UIKit
class Leaf: UIView {
var action: (Int) -> () = { _ in }
var missilesFired = 1 {
didSet {
label.text = "\(missilesFired) Missiles Fired"