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 / logger.js
Created February 23, 2016 19:34
example gist description
console.log('hello js!');
@rlemon
rlemon / client.js
Last active February 16, 2016 16:34
simple node websocket example
const conn = new WebSocket('ws://127.0.0.1:8080');
conn.onopen = _ => {
// connection is open
};
conn.onerror = err => {
console.error(err);
// you have an error
};
conn.onmessage = message => {
// process message.data
@rlemon
rlemon / queue.js
Created February 9, 2016 21:36
queue in js (fifo)
class Queue {
constructor() {
this.oldIndex = 1;
this.newIndex = 1;
this.storage = {};
}
size() {
return this.newIndex - this.oldIndex;
}
enqueue(data) {
"bot_learn":"{\"3\":\"{\\\"name\\\":\\\"3\\\",\\\"output\\\":\\\"<>http://www.wpclipart.com/education/animal_numbers/animal_number_3_T.png\\\",\\\"input\\\":\\\"/.*/\\\",\\\"creator\\\":\\\"tarboy9\\\",\\\"creatorID\\\":5521842,\\\"date\\\":\\\"2015-11-04T00:49:33.523Z\\\",\\\"description\\\":\\\"User-taught command: `<>http://www.wpclipart.com/education/animal_numbers/animal_number_3_T.png`\\\"}\",\"666\":\"{\\\"name\\\":\\\"666\\\",\\\"output\\\":\\\"<> ಊ(╰◣▂ ◢╯)Ψ\\\",\\\"input\\\":\\\"/.*/\\\",\\\"creator\\\":\\\"monners\\\",\\\"date\\\":\\\"2014-04-14T07:41:52.847Z\\\",\\\"description\\\":\\\"User-taught command: `<> ಊ(╰◣▂ ◢╯)Ψ`\\\"}\",\"put..it..back...ლ(ಠ益ಠ)ლ\":\"{\\\"name\\\":\\\"put..it..back...ლ(ಠ益ಠ)ლ\\\",\\\"output\\\":\\\"<>┬─┬ ノ( ゜-゜ノ)\\\",\\\"input\\\":\\\"/.*/\\\",\\\"creator\\\":\\\"rlemon\\\",\\\"date\\\":\\\"2014-04-01T02:22:04.467Z\\\",\\\"description\\\":\\\"User-taught command: `<>┬─┬ ノ( ゜-゜ノ)`\\\"}\",\"phucket\":\"{\\\"name\\\":\\\"phucket\\\",\\\"output\\\":\\\"<> http://i.stack.img
@rlemon
rlemon / motion.md
Last active January 20, 2016 14:06
motion install for rpi2

Following this instructions made motion working on a latest released jessie on rpi2:

sudo apt-get install -y libjpeg-dev libavformat56 libavformat-dev libavcodec56 libavcodec-dev libavutil54 libavutil-dev libc6-dev zlib1g-dev libmysqlclient18 libmysqlclient-dev libpq5 libpq-dev

wget https://www.dropbox.com/s/6ruqgv1h65zufr6/motion-mmal-lowflyerUK-20151114.tar.gz

tar -zxvf motion-mmal-lowflyerUK-20151114.tar.gz
./motion -c motion-mmalcam-both.conf
@rlemon
rlemon / db.js
Created January 17, 2016 23:40
pg + bluebirdd
import pg from 'pg';
import bluebird from 'bluebird';
import configs from './configs.js';
bluebird.longStackTraces();
bluebird.promisifyAll(pg);
bluebird.promisifyAll(pg.Client.prototype);
exports default function(fn) {
return pg.connectAsync(configs.dbConnectionString).bind({}).spread(function(client, close) {
(function() {
'use strict';
const filterWords = [
"alabama hot pocket",
"alaskan pipeline",
"apeshit",
"arsehole",
"ass",
"asshole",
@rlemon
rlemon / mead.md
Last active November 2, 2015 14:06

#Mead ##Required Equiptment

  1. 23L Carboy (glass) - I get these for $50/per
  2. large funnel (make sure it fits in the carboy with a small air gap)
  3. Fine mesh metal strainer (get it at the dollar store, they are cheap)
  4. siphon
  5. airlock and bung (again, get the ones that fit your carboy, they are cheap. like $2)
  6. sterilizer (every country has a different name brand, goto a wine store and ask. should be a powder for very very cheap)
  7. cleaner (bleach or bleach like substance. this is for after you're done to clean everything.)
  8. Bottle capers are like $15 or you can rent them come bottling day.
@rlemon
rlemon / spinner.base64
Created October 7, 2015 15:19
base 64 spinner
R0lGODlhGAAYAKUAACQiJIyKjLy+vFRWVDw6PNza3KSmpHRydCwuLJSWlMzOzGRmZERGROTm5LS2tISGhCwqLJSSlMzKzFxeXERCROTi5KyurHx6fDQ2NJyenNTW1GxubExOTOzu7CQmJIyOjMTCxFxaXDw+PNze3KyqrHR2dDQyNJyanNTS1GxqbExKTOzq7Ly6vCIiIgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQJBgAtACwAAAAAGAAYAAAGosCWcEgUpkqQopLoETIeoEoHlaAslQ6WosPlagSOzZUIemBMqhQoUnocTONhqRmv2+/4vH7P78c9HEKAfQYkKiYFF3wXICYIHyMEewYpLR4aBQl0dyENcC0kKysnAHYAIgUoQxkNHRZJdQMoHQZDKgsdDRh2AVyVRCkVAXUmICMrAaVEAxoqcScaFSmbRAsFDiFLHigPA3EWE1cQGwh11H57QQAh+QQJBgArACwAAAAAGAAYAIUkIiSMioxUVlTEwsQ8Pjzc2tykpqR0cnQ0MjRMSkzk5uSUlpRkZmTMzsy0srQsKiyEgoSUkpRcXlzMysxERkTk4uSsrqw8OjxUUlTs7uwkJiSMjoxcWlzExsREQkTc3tysqqx0dnQ0NjRMTkzs6uycnpxsamzU0tS8urwsLiyEhoQiIiIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGpsCVcEgkCkTFJNGzMTEgJUfnJAAok5yGA1TIeCuKBfI6ZAiEmpGj0iGVBggyuphCaDySqnzP7/v/gHIXgUUPDQyEQxcBA4lCFBUVg4AqDysEHx8lGoAlKBcCJBkVGIAoERoUBxkkcX4HA5wrACAZEn0aBwomRCkTEXwXtRWyQwQnY2QbXhtKJR0BKVccJyQKHEoMEQR
@rlemon
rlemon / cider.md
Last active September 29, 2015 00:30
Making Cider

Making Hard Cider (easy)

Required Equiptment:

  1. 23L (5 Gal) carboy.
  2. Vapour lock and bung that fits your carboy (normally this can be purchased at the same place as the carboy).
  3. Brewers yeast. There are many different kinds and I normally find "D47" yeast to be the best, but close champagne yeasts should do good enough. Do not use bakers yeast. I normally put two packs into a carboy. However if you notice it is not fermenting past 1 and a half weeks add another and gently swish the cider around in the carboy.
  4. Apple Cider. I use 12L of pasteurized apple cider purchased from my local grocer. If you can get unpasteurized ensure you heat it to ~90C (194F) for 30 minutes. DO NOT BOIL IT!.
  5. Santizer. StarSan is what most people use, but any phosphoric acid should work.
  6. Bleach. This is used to clean the carboy after used. Do this immediatly after bottling to avoid using a brush to get off nasty spots.