Skip to content

Instantly share code, notes, and snippets.

View rlemon's full-sized avatar
🍋
Hanging around.

Robert Lemon rlemon

🍋
Hanging around.
  • Dryer Moisture Systems Inc.
  • Kitchener, Ontario. Canada.
View GitHub Profile
@rlemon
rlemon / fetchWithProgress.js
Last active April 27, 2018 13:56
fetch with progress
async function fetchWithProgress(file, options = {}, progressUpdate = null) {
try {
const fileResponse = await fetch(file, options);
const totalBytes = fileResponse.headers.get('content-length');
// if there is no content length, we can't calculate any progress.
// also if there is no provided callback, there is no point.
if( totalBytes === null || progressUpdate === null ) {
if( totalBytes === null ) console.error('content-length not available');
return fileResponse;
@rlemon
rlemon / canned.js
Last active April 25, 2018 18:00
const KEYWORD_MAP = {};
/*
KEYWORD_MAP[<user_id>][<term>] returns the reply
*/
KEYWORD_MAP[774078] = {
'jesus': 'https://i.imgur.com/6Vv7kyL.png'
};
KEYWORD_MAP[617762] = {
'BAM!' : 'SPACE GUN!'
};

First off, you need minced pork meat. Usually shoulder meat, but any will probably work just as fine (just don't get any super thick/fatty part).

You will also need: leek, tomatoes, cabbage, any kind of stock (veggie stock seems to work the best), salt, pepper.

Now, take the white parts of leek, finely chop and saute them a little. In the meantime, boil rice. You will use approx. 1/4 part rice per 1 part meat.

Now, add both the rice and leek to the minced meat and season with salt and pepper. In the very traditional recipes you might not find leek, but its kinda like a family secret thing - it adds moisture to the usually dry insides of golabki and makes them nice and succulent.

/*
Random crystal generator for Thingiverse Customizer
Fernando Jerez 2016
*/
// This is only to force Customizer create many files. Changes doesn´t matter. Just click CREATE THING
part = "one"; // [one:Crystal #1, two:Crystal #2, three:Crystal #3, four:Crystal #4,five:Crystal #5,six:Crystal #6,seven:Crystal #7,eight:Crystal #8,nine:Crystal #9,ten:Crystal #10]
# Game Start
MAKE A BEDROOM! no seriously, if your colonists sleep on the ground they'll be pissed. make a bedroom and some beds first.
Then make covered area for your supplies so they don't get destroyed by the sun. you don't need walls on this building at first. just four corners and a roof.
[x][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][x]
[ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
[ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
[ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
[ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
@rlemon
rlemon / file.md
Last active November 30, 2017 14:20

Must Havs:

EB Prepare Carefully - lets you setup the game before hand. tweak skills and items before world gen. I highly recommend installing it, even if you don't use it in the menu options. Note: it doesn't change gameplay, just setup.
More Floors - makes the game less boring to look at
Feed The Colonists - adds an option to make 4X meals instead of 1X meals, doesn't change how many resources are used, just lets you make 4 meals at once.
More Furniture - makes the game less boring to look at, and offers a few pieces that add some perks to bedrooms.
Rim Fridge - adds friges. honestly this should be in the stock game.

Nice to have:

RT Fuses - adds a fuse part to the game so electrical shorts don't just blow your shit up.
Infused - makes raiders drop infused items (items with bonuses).

@rlemon
rlemon / 1.md
Last active August 10, 2017 01:34

here is where the conversation started that has been the core of the earlier kicks.
Ben Fortune and I had some disagreements.

Later I was asking some questions and Benjamin had a response (response)

which lead to this conversation:

Benjamin Gruenbaum: @Tobiq in Chrome (V8) every object has an indexed int store, an object should be slightly faster than an array if you knew how to benchmark stuff.
Tobiq: show me some results or stop throwing claims around
Benjamin Gruenbaum: Yeah, I don't owe your dumb ass anything
Tobiq: then shut up

youtube makers rlemon enjoys.

Chandler Dickinson - https://www.youtube.com/channel/UCbpVXfX0GBy6Z2vqIwANdEA -- he's an ex-programmer turned blacksmith. uses very simple tools, no power hammer.

Alec Steele - https://www.youtube.com/channel/UCWizIdwZdmr43zfxlCktmNw -- he's a young (like <20) kid from the UK who makes outstanding videos and product. loves Damascus.

Peter Sripol - https://www.youtube.com/channel/UC7yF9tV4xWEMZkel7q8La_w -- he does DIY rc stuff. really neat channel.

Samuria Carpenter - https://www.youtube.com/channel/UC06fO6LNH_AUgjbmqaZRV5Q -- he's slightly annoying, but Canadian and makes outstanding wood working products.

@rlemon
rlemon / tagged_template_literals_fn.js
Created April 3, 2017 20:06
tagged template literals fn.js or, what am I doing with my life?
function fn(v, ...args) {
const f = new Function([...args].map((_,i)=>`$${i}`), v.join('').split('|')[1]);
f.name = v[0][0]; // this does nothing.
return f.apply(null, args)
}
const b = fn`add ${2} ${2} ${3} |
let a = $0;
let b = $2;
return a + b;
@rlemon
rlemon / asyncloadImage.js
Last active April 3, 2017 17:37
async load image for js
async function loadImage(url) {
const res = await fetch(url, { mode: 'cors' });
const buff = await res.arrayBuffer();
const img = new Image();
const data = btoa([...new Uint8Array(buff)].map(c=>String.fromCharCode(c)).join(''));
img.src = `data:image/jpeg;base64,${data}`;
return img;
}