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
// OLED black smearing test for Processing 3.4. | |
// Black smearing = changing pixels to and from pure black is slower than changing to and from other colours. | |
// | |
// Code by @marcedwards from @bjango. | |
void setup() { | |
size(360, 360, P2D); | |
frameRate(60); | |
smooth(8); | |
noStroke(); |
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
require 'net/ntp' # gem install net-ntp | |
# Windows' date command expects MM/DD/YYYY, e.g. 5/15/2009 | |
DATE_FORMAT = '%m/%d/%Y' | |
# Windows' time command expects HH:MM:SS AM/PM, e.g. 5:34:00 PM | |
TIME_FORMAT = '%I:%M:%S %p' | |
# External NTP is now firewalled :( | |
NTP_SERVER = 'MILLDATA' |
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
1. kn0thing | |
2. spez | |
3. third | |
4. fifth | |
5. fourth | |
6. agentorange | |
7. chickenlittle | |
8. erzengel | |
9. fizzypop | |
10. madmax2 |
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 fs from 'fs'; | |
import { exec } from 'child_process'; | |
const compilationConfig = JSON.parse(fs.readFileSync('compilerconfig.json', 'utf8')); | |
compilationConfig | |
.filter(fileConfig => fileConfig.inputFile.endsWith('.less')) | |
.map(({outputFile, inputFile, minify}) => { | |
try { | |
console.log("LESS\tInput:\t" + inputFile); |
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
/** | |
* Recursively navigates into nested collections inside `collection` by | |
* following a sequence of properties `pathArray`, executing any methods | |
* along the way, and returning the first `undefined` encountered. | |
* @param {any} collection - The collection to traverse. | |
* @param {Array<string|number|function()>} pathArray - A sequence of | |
* property names, indexes, or functions to traverse into the `collection`. | |
* @returns {any|undefined} The final value found, | |
* otherwise the first `undefined` encountered. | |
* @example |
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
const cat = { | |
get state() { | |
delete this.state; | |
this.state = Math.random() >= 0.5 ? 'Alive' : 'Dead'; | |
return this.state; | |
} | |
}; |
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
[General] | |
bGamepadEnable=0 | |
sIntroSequence=0 | |
bSkipSplash=1 | |
bDisableAllGore=0 | |
[Display] | |
uiOrthoShadowFilter=3 | |
bVolumetricLightingEnable=0 | |
iSize H=1080 | |
iSize W=1920 |
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
const advise = (fn, preFn = (...args) => args, postFn = (...args) => args) => | |
(...args) => | |
postFn(fn(...preFn(...args))); | |
add = (x, y) => | |
x + y; | |
advisedAdd = advise( | |
add, |
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
const logged = logF => f => | |
(...args) => { | |
const output = f(...args); | |
console.log(logF(args, output)); | |
return output; | |
}; | |
function writeFile(filename) { | |
console.log(`[ACTUALLY DOING STUFF WITH ${filename}]`); | |
} |
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
cons = a => b => f => f(a)(b) | |
car = a => b => a | |
cdr = a => b => b | |
reduce = f => i => l => | |
l | |
? reduce (f) (f(i)(l(car))) (l(cdr)) | |
: i | |
l = cons(1)(cons(2)(cons(3)(null))) |
NewerOlder