Skip to content

Instantly share code, notes, and snippets.

View devinrhode2's full-sized avatar
😀

Devin Rhode devinrhode2

😀
View GitHub Profile
@devinrhode2
devinrhode2 / npmProcessNextTickErrorsWithAnyNPM_command
Created February 2, 2012 23:12
process.nextTick errors with any use of npm
$ npm -v
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: No such module
at Object.<anonymous> (/usr/lib/node_modules/npm/lib/utils/config-defs.js:5:21)
at Module._compile (module.js:444:26)
at Object..js (module.js:462:10)
at Module.load (module.js:351:31)
@devinrhode2
devinrhode2 / jsdoc-samples
Created February 17, 2012 02:02
sample jsdoc annotations pulled from some of google's sample chrome extensions
Ripped apart jsDoc stuff from http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml
Here's the best stuff you should know about:
/**
* @license MIT style, use however you wish.
* @fileoverview Some utilities.
* @author [email protected] (Devin Rhode)
*/
/**
@devinrhode2
devinrhode2 / Email input placeholders.
Created February 27, 2012 09:54
Email input placeholders.
<!--
for AirPR.com's coming soon landing page, on a specific issue generally
applicable to anyone on the web looking to use this input & placeholder design
Problem: email placeholder text gets cut off with different zoom levels,
and surely mobile has some inconsistencies. Also, when you click in to type
an email, your cursor is overlapping the placeholder text
-->
<!-- Add this to the top of your code -->
<style type="text/css">
@devinrhode2
devinrhode2 / express-filesystem-based-routing
Created February 29, 2012 23:20
File system based routing within express
In express app.js, remove all app.get routings, and put this:
app.get('*', function(req, res) {
file = req.params[0].substr(1, req.params[0].length);
console.log('requesting: ' + file);
res.render(file, {locals: {
request: req,
params: req.query
}}); //in your .jade file, variables request and params are available.
})
@devinrhode2
devinrhode2 / gitissue
Created March 5, 2012 04:54
git issue on nodester
having problems with git with my node app on nodester (similar to heroku).
I did a force push to nodester, and I believe it merged my
server.js file with the starter server.js file,
resulting in an error on the <<<<<HEAD line git adds.
tried git push --force nodester master a few times, along with
git pull nodester master, and git fetch nodester master
What's more, when I do git fetch nodester master, I get:
* branch master -> FETCH_HEAD
@devinrhode2
devinrhode2 / githell
Created March 5, 2012 19:00
remote repo has unmerged files, push doesn't change site.
$ git init drtest
Initialized empty Git repository in /Users/rangetutoring/Desktop/drtest/.git/
$ cd drtest
$ nodester app info devinrhode2
nodester info Gathering information about: devinrhode2
nodester info devinrhode2 on port 14777 running: true (pid: 4858)
nodester info gitrepo: [email protected]:/node/git/devinrhode2/......git
nodester info appfile: server.js
$ git remote add nodester [email protected]:/node/git/devinrhode2/.........git
$ git remote
@devinrhode2
devinrhode2 / What do I do?
Created March 8, 2012 04:27
Friend asks, what do I do?
**Parker**
"Wtf do you do"
**Devin Rhode**
"That is a great question! This has been my task for the past week and... I'm either going to do a tech startup company... or probably work at stumbleupon, or another cooler company using making the rails for node (if they get funding). Or another company, who knows. Could work on walmart.com, this ad network, .... million jobs out in cali for programmers.
So, I don't know what I do. Day to day I've been learning a new framework/toolset for making web apps called Node.js. I need a job though.
Fun fact: after having a few lime chips you gave me during summer program, I've been buying them basically every time I go grocery shopping."
@devinrhode2
devinrhode2 / js-on-document_start
Created March 14, 2012 03:35
Chrome extensions, injecting javascript on document_start
//In your manifest.json, this is sample code for running a content script on 'document_start'
"content_scripts": [
{
"all_frames": false,
"js": [ "start.js", "main.js" ],
"matches": [ "*://*.domain.com/*" ], //over match urls, you can be more precise in start.js
"run_at": "document_start"
}
],
@devinrhode2
devinrhode2 / case4stylus
Created March 27, 2012 02:03
my case for stylus (compile to css)
body {
border-radius: 5px; //this auto expands to include -webkit- and -moz- border radii
//as you see, comments are more natural.
opacity: 0.5; //this auto-expands to include the IE filter, whatever it is.
}
//use a variable:
$color = gray;
/*
I can either
1. Not give the frame top navigation permission, but ensure navigation occurs by intercepting requests, and making them occur in scout, in the frame. If the frame needs to take over the top frame, if can postMessage up and I can handle it intelligently.
2. Wrap all javascript in a spoofer, so it doesn't think it's in a frame. ...Still potentially has the issue of _top targeted links. onBeforeRequest can detect this, and point back to frame navigation.