Skip to content

Instantly share code, notes, and snippets.

View schmidsi's full-sized avatar
🦩

Simon Emanuel Schmid schmidsi

🦩
View GitHub Profile
@schmidsi
schmidsi / firstResult.js
Created July 13, 2017 12:53
functional helper to execute every function in a list and return the value of the first function which not returns false
// functional helper to execute every function in a list
// and return the value of the first function which not returns false
const firstResult = (...args) => functionList =>
functionList.find(f => f(...args))(...args);
// Example (a stupid one):
const decisionList = [
(a, b) => a > b ? 'a greater than b' : false,
(a, b) => a < b ? 'a smaller than b' : false,
() => 'a equal b',
Array(5).fill().map((item, index) => index);
// [ 0, 1, 2, 3, 4 ]
@schmidsi
schmidsi / galaxy-env-vars.js
Created July 3, 2017 13:17
ENV Vars provided by galaxy.meteor.com
Meteor.settings = {
PrerenderIO: {
token: '*',
prerenderServiceUrl: 'https://service.prerender.io'
},
'galaxy.meteor.com': {
env: {
MONGO_URL: 'mongodb://*',
ROOT_URL: 'https://staging.melonport.com'
}
0x6D32657f13e771472BdDCD31DE968de84397b7C6
0x546457bbDdf5e09929399768AB5a9D588Cb0334d
<form action="https://krysi-csrf-express.now.sh/transfer" method="POST">
<input type="hidden" name="payee" value="eve" />
<input type="hidden" name="amount" value="1234051234" />
<button type="submit">If you're sexy and you know it, click me ;)</button>
</form>
@schmidsi
schmidsi / subprocess.js
Last active May 22, 2017 13:08
Simple node.js script that can start meteor and wait until it is loaded to run chimp tests
// Inspired from: https://github.com/xolvio/qualityfaster/blob/master/.scripts/
import { exec } from 'child_process';
const meteorCommand = process.argv[2];
const chimpCommand = process.argv[3];
const meteorProcess = exec(meteorCommand); // 'npm start'
meteorProcess.stdout.pipe(process.stdout);
meteorProcess.stderr.pipe(process.stderr);
@schmidsi
schmidsi / .block
Last active January 12, 2024 00:54
Order Book Visualisation
license: gpl-3.0
@schmidsi
schmidsi / README.md
Last active August 2, 2023 16:45
How we react/redux