Skip to content

Instantly share code, notes, and snippets.

// hi, this explains the current bot architecture. comment pl0x.
// this is the object which the bot sees (and all listeners/commands receive)
var message = {
text : 'message text sans any invocation stuff',
user : {
name : '',
id : '',
reputation : '',
isOwner : function () { /*...*/ }
/*
* stepper pins
*/
int Pin0 = 2;
int Pin1 = 3;
int Pin2 = 4;
int Pin3 = 5;
int timeout = 1;
@rlemon
rlemon / roomtalks.md
Last active August 29, 2015 14:22
Room Talks

Room Talks

Okay so let's try this out.

I'm curating a list of potential speakers to give short (5-30 minute) talks on Google Hangouts (later exported to youtube) for the benefit of the room.

Think about it, if you feel like you could teach anyone in the room about anything (React, JS, Math, how to change your own engine oil, literally anything) please comment with what you could potentially speak on. Once a list is made we can (at your own leisure of course) start to actually schedule the talks and make this happen.

100% of your own good will, 50% because we are awesome (someone needs to do a talk on percentages for me).

@ryankinal
ryankinal / css-links.md
Created November 10, 2011 21:49
Useful CSS links for easy reference
@rlemon
rlemon / gist:1404876
Created November 29, 2011 13:59
do not use innerHTML
//when you do this:
elem.innerHTML = 'I want to set elem\'s text!';
//you're calling the browser's html parser. why so surprised? innerHTML takes an html string and turns it into DOM elements.
//you can't do that without calling an html parser.
//after the browser is done parsing your (invalid) html, it sees that it only contains text and _assumes_ you just want text and puts it into
//a text node.
//now what? it empties the element out of everything and appends the new text node. it then re-parses, re-flows and re-paints your entire page
// (since your innerHTML call can do many other things, and affect everything else in the page)
@Raynos
Raynos / critique.md
Created December 1, 2011 14:15
jQuery library critique

jQuery

Related: [Why you don't need jQuery as an abstraction][2]

$ itself is a god object. Everything goes on it. The standard plugin / extension architecture that is recommended is to just bolt more methods on $ itself!

Surely this is bad. An example would be how we have both $.load which is overloaded to do completely different things. If they were on two separate sensibly named objects $Container.load and $EventTarget.load. Personally I would deprecate the latter in favour of .on('load'

The animation should be it's own little modular thing, not bolted onto $. Ajax should be it's own little modular thing, not bolted onto $

@rlemon
rlemon / gist:1443248
Created December 7, 2011 15:39
Good Answers
http://stackoverflow.com/a/8417913/829835 [Class vs. ID - Readability]
@rlemon
rlemon / gist:1472061
Created December 13, 2011 13:03
u mad bro?
/*
█░░░░░█░░░░░░░░░░░░░░░░░░░░░█░░█░░░░░░░░░░░░░░█▀▀█
█░█▀█░█░░█░█░░█▀█▀█░█▀▀█░█▀▀█░░█▀▀█░█▀▀░█▀▀▀█░░░░█
█░█░█░█░░█░█░░█░█░█░█▀▀█░█░░█░░█░░█░█░░░█░░░█░░▀▀▀
▀░▀▀▀░▀░░▀▀▀░░▀░░░▀░▀░░▀░▀▀▀▀░░▀▀▀▀░▀░░░▀▀▀▀▀░░█░░
*/
@ryankinal
ryankinal / ids-in-css.md
Created December 13, 2011 21:40
Thoughts and points on the "IDs in CSS" issue

The whole ID thing

There is a war going on. In comment threads and chat rooms, we are doing battle.

Here are the arguments against IDs:

  • specificity wars
  • strong coupling
  • code reusability
  • abstraction
@rlemon
rlemon / gist:1492372
Created December 18, 2011 04:31
loadScript :p
function loadScript(url, callback) {
if(!url) {
return;
}
callback = typeof callback == 'undefined' ? function(){} : callback;
var script_elm = document.createElement('script');
script_elm.src = url;
script_elm.onreadystatechange = function() {
if (this.readyState == 'complete') {
callback.call();