- 100g oats.
- 100g sugar.
- 100g self raising flour.
- 100g hard margarine/unsalted butter.
- 1tbsp golden syrup.
- 1tsp bicarbonate of soda (or baking powder) dissolved in a little warm water.
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
name: Dynamic parallelism | |
run-name: Dynamic parallelism ${{ github.ref_name }} with ${{ toJson(inputs) }} | |
on: | |
workflow_dispatch: | |
inputs: | |
parallelism: | |
description: How many jobs to run in parallel | |
required: true | |
type: string | |
default: '1' |
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 enum JitterDirection { | |
UP = 'up', | |
DOWN = 'down', | |
UP_DOWN = 'up_down', | |
} | |
/** | |
* @param {Number} value Value to jitter. | |
* @param {Number} factor How much jitter to apply. | |
* @param {JitterDirection} direction Whether to return bigger, smaller or either values. |
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 { useState } from 'react'; | |
const marshall = (value: any) => JSON.stringify(value); | |
const unmarshall = (value: string) => JSON.parse(value); | |
const getBaseLS = <T>(getDefaultValue: () => T, key: string): T => { | |
const stored = window.localStorage.getItem(key); | |
if (stored) { | |
return unmarshall(stored) as 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
combineUnique(...list) { | |
return list | |
.filter((value) => value && value.length) | |
.reduce((total, current) => [ ...total, ...current ], [ ]) | |
.reduce((total, current) => { | |
if (!total.find((value) => current === value)) { | |
total.push(current); | |
} | |
return total; | |
}, [ ]); |
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 * as _ from 'lodash'; | |
/** | |
* @param {string} blockableKey property to attach to the instance to denote method activity | |
* @param {boolean} blocking option to disable subsequent calls to function while executing | |
* @return {object} function descriptor decorated for monitoring method activity | |
* @desc adds a property saying that the function is currently being called, useful for blocking ui | |
*/ | |
export default (blockableKey, blocking = false) => | |
(target, key, descriptor) => { |
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 | |
total='0' | |
for i in `grep -r -I -l . .`; do | |
total=$(expr $total + `wc -l $i | awk '{ print $1 }'`) | |
done | |
echo $total |
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 * as _ from 'lodash'; | |
export default (target, key, descriptor) => { | |
const { get, set } = descriptor; | |
return { | |
...descriptor, | |
get: function getAndCache() { | |
const isStatic = !_.isObject(this); | |
const cacheProperty = isStatic ? '__staticCache' : '__cache'; | |
// checking for cache clearing properties |
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
# moves to path/opens file in vim | |
# @param path or file | |
function cd { | |
if [ -z $1 ]; then | |
builtin cd ~/ | |
elif [ -d $1 ]; then | |
builtin cd "$1" | |
elif [[ $1 == \.\.\.* ]]; then | |
for (( i=0; i<`expr ${#1} - 1 `; i++ )); do | |
builtin cd .. |
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
git ls-files --deleted -z | git update-index --assume-unchanged -z --stdin |
NewerOlder