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/sh -ex | |
MEMORY_LIMIT=$(lsmem -o SIZE -b | awk '{s+=$1} END {print s/1024/1024}') | |
MAX_OLD_SPACE_SIZE=$(expr $MEMORY_LIMIT \* 3 / 4) | |
exec node --max-old-space-size=$MAX_OLD_SPACE_SIZE "$@" |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Septembre 2019</title> | |
<style> | |
body { | |
margin: 2em auto; | |
width: 80%; |
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 React from "react"; | |
import styled, { keyframes } from "styled-components"; | |
const Jump = keyframes` | |
0% { | |
transform: translateY(0px); | |
} | |
20% { | |
transform: translateY(-16px); | |
} |
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 { observable } from "mobx"; | |
export default class ObservableSet<T> implements Set<T> { | |
[Symbol.toStringTag]: "Set"; | |
[Symbol.iterator](): IterableIterator<T> { | |
return this.values() | |
} | |
entries(): IterableIterator<[T, T]> { |
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
function calc(acc, input) { | |
if (input.match(/^[-+*\/=]$/)) { | |
const split = acc.match(/^(-?\d+(?:\.\d*)?)(?:[-+*\/=]*)([-+*\/=])(\d+(?:\.\d*)?)$/) | |
if (!split) | |
return acc + input | |
const [_, x, op, y] = split | |
const ops = { | |
'+': (x, y) => x + y, | |
'-': (x, y) => x - y, | |
'*': (x, y) => x * y, |
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 java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.HashSet; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
import org.jenetics.Genotype; | |
import org.jenetics.IntegerChromosome; | |
import org.jenetics.IntegerGene; | |
import org.jenetics.engine.Engine; |
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 -ex | |
############################## | |
# Android SDK installation # | |
############################## | |
# Detect OS | |
case $OSTYPE in | |
linux*) PLATFORM=linux ;; | |
darwin*) PLATFORM=macosx ;; |
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 | |
function list { | |
xinput list --name-only | grep Wacom | |
} | |
function create { | |
xinput create-master 'Wacom' | |
list | xargs -i{} xinput reattach {} 'Wacom pointer' | |
list | grep Pen | xargs -i{} xinput map-to-output {} 'DVI-0' |
NewerOlder