Skip to content

Instantly share code, notes, and snippets.

View stayradiated's full-sized avatar
🏃‍♂️
Running fast!

George Czabania stayradiated

🏃‍♂️
Running fast!
View GitHub Profile
@stayradiated
stayradiated / Bagels.md
Last active October 12, 2020 20:16
The best bagel recipe

Bagels

Makes 12 fantastic bagels.

Ingredients

Sponge:

  • 4 Cups (550g) Bread Flour
  • 1 Teaspoon Instant Yeast

Ultimate Chocolate Cookies

Makes 10 rather large cookies

When you take the cookies out of the oven they will not look cooked, it is vital you know this, as it will be very tempting to leave them in for longer and then they’ll be hard and overcooked once they are cool. Just take your cookies out after 11 minutes and then leave them to cool.

Ingredients

  • 200g butter
  • 300g caster sugar
interface BinaryTreeNodeJSON<Value> {
value: Value,
left?: BinaryTreeNodeJSON<Value>,
right?: BinaryTreeNodeJSON<Value>,
}
class BinaryTreeNode<Value> {
static from<Value> (json: BinaryTreeNodeJSON<Value>): BinaryTreeNode<Value> {
const { value, left, right } = json
const leftNode = left != null ? BinaryTreeNode.from(left) : undefined
function! Dab()
let [line_start, column_start] = getpos("'<")[1:2]
let [line_end, column_end] = getpos("'>")[1:2]
if line_end - line_start > 0
" collapse
normal va{J
else
" expand
normal va{
s/[{,]/\0

😀 :grinning:

😃 :smiley:

😄 :smile:

😁 :grin:

😆 :laughing:

@stayradiated
stayradiated / data.csv
Created March 12, 2017 22:51
D3 Dot Graph
snap audience
0 100
1 95
2 82
3 78
4 61
5 59
6 42
7 30
8 29
@stayradiated
stayradiated / img2vid
Last active January 11, 2024 15:33
Concatenate Videos and Images using ffmpeg
#!/usr/bin/env bash
#
# img2vid
# =======
#
# Convert an image into three second video
#
# Usage: ./img2vid photo.jpg video.mp4
#
var successPromise = new Promise(function (resolve, reject) {
setTimeout(resolve, 1000);
});
successPromise.then(function () { console.log('this should succeed') });
var failingPromise = new Promise(function (resolve, reject) {
setTimeout(reject, 1000);
});
@stayradiated
stayradiated / lines.sh
Created February 3, 2016 03:06
Find number of lines of code in a folder recursively (excluding tests)
find . -iname '*.js' -not -path "*/__tests__/*" -exec wc -l {} \; | ag -o \\d+ | paste -sd+ - | bc
@stayradiated
stayradiated / storage.js
Last active May 5, 2020 15:56
Import & Export localStorage between domains
function exportLocalStorage () {
var output = {};
for (var key in localStorage) {
if (!localStorage.hasOwnProperty(key)) {
continue;
}
output[key] = localStorage[key];
}
return JSON.stringify(output).replace(/'/g, '\\\'').replace(/"/g, '\\"');
}