Skip to content

Instantly share code, notes, and snippets.

View Yord's full-sized avatar

Philipp Wille Yord

  • Braunschweig, Germany
View GitHub Profile
\documentclass{article}
\input{list}
\def\times#1#2{\newcount\int\int\numexpr#1*#2\relax\the\int}
\begin{document}
\List[new]{numbers}{1,2,3,4,5,6,7,8,9}
@Yord
Yord / MultipleChoice.scala
Created August 20, 2012 20:00
Little Multiple Choice Programm
import util.Random
import io.Source
object MultipleChoice extends App {
implicit def colorString(string: String) = new ColoredString(string)
val buffer = Source fromFile "mc.txt"
val Line = """^([wf]):(.+)$""".r
val questions = buffer.getLines flatMap (_ match {
// If you haven't already, watch Brian Lonsdorf's "Hey Underscore, You're Doing It Wrong!":
// http://functionaltalks.org/2013/05/27/brian-lonsdorf-hey-underscore-youre-doing-it-wrong/
const { append, eqProps, identity, map, mergeWith, nthArg, pipe, reject, when } = require('Ramda');
const idEquals = eqProps('id');
// Reducers as data-less action function (returns a function that
@Yord
Yord / lisp.json.js
Last active May 17, 2024 07:26
This is a LISP that is also valid JSON 😮. Don't ask me what I was thinking when I wrote it...
console.log('["lisp",{"dot":"json"}]\n')
// import { and, apply, assoc, concat, contains, dissoc, equals, head, init, is, isEmpty, isNil, keys, last, map, o, pick, pipe, prepend, propOr, reduce, reverse, tail, type } from 'ramda'
// HELPERS
const isUndefined = a => typeof(a) === 'undefined'
//const may = (err, res) => ({ err, res })
const res = res => ({ res })
@Yord
Yord / csv-template-literal.js
Last active September 18, 2018 22:02
A javascript template literal transforming a csv to a list of json objects.
// Ramda 0.25.0
import { defaultTo, eqBy, chain, flatten, head, ifElse, join, length, map, of, pipe, split, tail, transpose, trim, zipObj } from 'ramda'
const interleave = pipe(transpose, flatten)
const trimmedValues = separator => pipe(split(separator), map(trim))
const csv = separator => (strings, ...expressions) => {
const lines = pipe(
interleave,
join(''),
@Yord
Yord / dotty-implicit-functions.scala
Last active October 30, 2018 05:54
This gist showcases dotty's implicit functions
// Paste e.g. in https://scastie.scala-lang.org
object Foo {
def main(args: Array[String]): Unit = {
def some[A](a: A): Option[A] = Some(a)
val inc: Int => Int = _ + 1
println(
map(inc)(List(1, 2, 3, 4))
Benchmark Description pxi gawk jq mlr fx
JSON 1 Select an attribute on small JSON objects 11s 15s 46s 284s
JSON 2 Select an attribute on large JSON objects 20s 20s 97s 301s
JSON 3 Pick a single attribute on small JSON objects 15s 21s 68s 91s 368s
JSON 4 Pick a single attribute on large JSON objects 26s 27s 130s 257s 420s
JSON to CSV 1 Convert a small JSON to CSV format 15s 77s 60s
JSON to CSV 2 Convert a large JSON to CSV format 38s 264s 237s
CSV 1 Select a column from a small csv file 11s 8s 37s 23s
CSV 2 Select a column from a large csv file 19s 9s 66s 72s
CSV to JSON 1 Convert a small CSV to JSON format 15s 120s

Warcaster

Dice

  • AD: White Action Dice
  • PD: Red Power Dice

Your Force

  • Models: Units and Void Gates