This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
plugins_and_versions_raw=$(grep -P "use\s+{" "$1" -A2) | |
AWK=$(cat<<'EOF' | |
match($0, /['"]([a-zA-Z\-_0-9\.]+\/[a-zA-Z\-_0-9\.]+)['"]/, res) {repo=res[1]} | |
match($0, /commit[[:space:]]*=[[:space:]]*.([^'"]+)./, res) {commit=res[1]; printf("%s#%s\n", repo, commit)} | |
EOF | |
) | |
plugins_and_versions=$(echo "$plugins_and_versions_raw" | awk "$AWK") | |
for plugin in $plugins_and_versions; do | |
vars=(${plugin//#/ }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/^[0-9]{4}-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\.[0-9]{3}/ { | |
if (contents !~ /(patterns|to|blacklist)/) { | |
printf("%s", contents) | |
} | |
contents = "" | |
} | |
{ contents = contents "\n" $0 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export abstract class A { | |
static make(input: boolean):A { | |
return input ? new B() : new C(); | |
} | |
abstract isB(): this is B; | |
abstract isC(): this is C; | |
abstract get(): number; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> [email protected] benchmarks /home/emmanuel/home/prelude.ts | |
> tsc && node ./dist/benchmarks/bench.js | |
Vector.filter x 20,872 ops/sec ±6.94% (69 runs sampled) | |
Array.filter x 11,289 ops/sec ±5.94% (73 runs sampled) | |
immList.filter x 28,128 ops/sec ±2.26% (82 runs sampled) | |
List.filter x 167,296 ops/sec ±0.89% (84 runs sampled) | |
Fastest is List.filter | |
Vector.map x 23,437 ops/sec ±1.15% (88 runs sampled) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.lecip.core.deployment; | |
import cz.habarta.typescript.generator.Settings; | |
import cz.habarta.typescript.generator.TsType; | |
import cz.habarta.typescript.generator.emitter.EmitterExtension; | |
import cz.habarta.typescript.generator.emitter.EmitterExtensionFeatures; | |
import cz.habarta.typescript.generator.emitter.TsBeanModel; | |
import cz.habarta.typescript.generator.emitter.TsPropertyModel; | |
public class TypeScriptEqualsHashcodeEmitter extends EmitterExtension { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# exiftool -T -TAG -FocalLength -TAG -Model **/*.jpg > ~/all_focals2.txt | |
library(readr) | |
library(ggplot2) | |
library(dplyr) | |
focals <- | |
read_delim('~/all_focals2.txt', delim='\t', | |
col_names=c("1", "focal", "2", "model"), | |
col_types=cols_only(focal = col_character(), model = col_character())) %>% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Map, List, Seq, Collection} from "immutable"; | |
declare module "immutable" { | |
module Collection { | |
interface Collection<K, V> { | |
concat(valuesOrCollections: Array<V>): Collection<K, V>; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javaslang.collection.*; | |
import javaslang.*; | |
public class SetNarrowTest { | |
static class PersonBase { | |
public final String name; | |
public PersonBase(String name) { | |
this.name = name; | |
} |