Skip to content

Instantly share code, notes, and snippets.

View devinrhode2's full-sized avatar
😀

Devin Rhode devinrhode2

😀
View GitHub Profile
@devinrhode2
devinrhode2 / writing
Created April 1, 2012 03:01
writing a gist
writing. We do it all the time. And I've just realized that I prefer writing a gist. Why? All I do is type CMD+ T, "gist" ENTER, and -write-
Now I don't even know what I came here to write.
...Backtracking in my tabs, reading a profile on OkCupid where this person described that the only thing they know for certain is that they love writing. They've wanted to do it since they were 12. Recently talking with David Adewumi, a mostly honorable entrepreneur I worked for for a bit, he asked "So what do you want to do?" I responded "I don't know, if I knew I'd probably be doing it"
Between these two points, I decided I'd come here and write out exactly what I want to do, and work up from there.
-I want to meet a great girl to spend a lot of time with. Would be amazing if she was also into startup, technology, and I'd melt if she could also code.
@devinrhode2
devinrhode2 / nodester-503
Created April 5, 2012 22:19
nodester 503-ing
My Nodester app 503's no matter what I do!
Try upgrading to node 0.6.12, assuring these 3 things are exactly as described in your base folder package.json file:
{
"name":"rhodester",
"node":"0.6.12",
"author":"devinrhode2"
}
@devinrhode2
devinrhode2 / js-debugging-trick.js
Created April 9, 2012 06:48
javascript debugging trick
var foo = function foo(parameter){
if (badParam(parameter)) {
//bark at whoever called this function
throw **foo.caller.name** + ' did ' + somethingBad; //bar
}
}
var bar = function bar(){
foo();
}
bar();
@devinrhode2
devinrhode2 / UA-Sniffing-FTW
Created April 9, 2012 07:44
UA-Sniffing-FTW
The internet abroad doesn't believe in UA sniffing. Maybe it
complicates things too much. I believe we can have a hybrid.
I thought hard about this. What the hell is so wrong about UA sniffing?
Ok, what if we don't have a user agent? I almost took the excuse:
"well, 90% of the time we'll have a UA (if not 100% of the time)
so, why worry about the 10%?"
EVERYBODY deserves the best experience their browser is capable of.
@devinrhode2
devinrhode2 / shitty-strings.js
Created April 13, 2012 02:59
String concatentation errors suck!
var script = document.createElement('script');
script.innerHTML =
'if (window.top !== window) { '+
' var subFrame = document.createElement("script"); '+
' subFrame.src = "'+chrome.extension.getURL('specific/sub_frame.js')+'";'+
' document.documentElement.appendChild(subFrame); '
'}';
document.documentElement.appendChild(script);
//gives "unexpected end of input", with no line numbers!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="">
<title></title>
<style type="text/css">
html {
background: -webkit-radial-gradient(circle,CenterColor,OuterColor);
background: -moz-radial-gradient(circle,CenterColor,OuterColor);
@devinrhode2
devinrhode2 / clean-scrollbar.css
Created May 2, 2012 03:42
Like, basically PERFECT scrollbars
/**
* Like, basically PERFECT scrollbars
*/
/*
It's pure CSS.
Since a quick google search will confirm people going crazy about Mac OS Lion scrollbars...
this has no fade-out effect.
In Mac OS Lion, the lowest common denominator is always showing scrollbars by a setting.
@devinrhode2
devinrhode2 / dabblet.css
Created May 2, 2012 07:39
Like, basically PERFECT scrollbars
/**
* Like, basically PERFECT scrollbars
*/
/*
It's pure CSS.
Since a quick google search will confirm people going crazy about Mac OS Lion scrollbars...
these scrollbars have no fade-out effect.
In Mac OS Lion, the lowest common denominator is always showing scrollbars by a setting.
@devinrhode2
devinrhode2 / fun-excercise.js
Created May 4, 2012 02:36
Fun excercise I did with a tech co-founder
/*
Task:
----------------------------------------------------
Fill the array 'randomNumbers' with 64 random numbers.
----------------------------------------------------
Requirements:
* You must use the provided getRandomNumber function.
* Make sure that there are no duplicate numbers in the array.
* Try to keep the running time reasonable!
@devinrhode2
devinrhode2 / streaming-page.js
Created May 13, 2012 04:36
Streaming in html from an xhr...
var url = 'http://thescoutapp.com/idea/'
, xhr = new XMLHttpRequest();
xhr.open('GET',url ,true);
xhr.onreadystatechange = function() {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
var resp = xhr.responseText;