Skip to content

Instantly share code, notes, and snippets.

View dignifiedquire's full-sized avatar

Friedel Ziegelmayer dignifiedquire

View GitHub Profile
@jaredhanson
jaredhanson / gist:2559730
Created April 30, 2012 16:20
Restify and Passport /cc Hal Robertson
// Based off example code from Hal Robertson
// https://github.com/halrobertson/test-restify-passport-facebook
// See discussion: https://groups.google.com/forum/?fromgroups#!topic/passportjs/zCz0nXB_gao
var restify = require('restify')
// config vars
var FB_LOGIN_PATH = '/api/facebook_login'
var FB_CALLBACK_PATH = '/api/facebook_callback'
var FB_APPID = '<<YOUR APPID HERE>>'
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@domenic
domenic / interop.md
Last active July 7, 2022 19:47
`module.exports =` and ES6 Module Interop in Node.js

module.exports = and ES6 Module Interop in Node.js

The question: how can we use ES6 modules in Node.js, where modules-as-functions is very common? That is, given a future in which V8 supports ES6 modules:

  • How can authors of function-modules convert to ES6 export syntax, without breaking consumers that do require("function-module")()?
  • How can consumers of function-modules use ES6 import syntax, while not demanding that the module author rewrites his code to ES6 export?

@wycats showed me a solution. It involves hooking into the loader API to do some rewriting, and using a distinguished name for the single export.

This is me eating crow for lots of false statements I've made all over Twitter today. Here it goes.

Node.js Resources

What is node.js?

Node.js is just JavaScript running on the server side. That's it. That's all there is to it.

Express

  • Express Docs, if you want to get started and already know JavaScript this is the place to be

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@joelmoss
joelmoss / gist:5743190
Last active December 18, 2015 06:59
Codio JS Class proposal

Codio Javascript Class Proposal

While the Codio Client has a simple inheritance system in the form of the core/context plugin, it leaves a little to be desired and is lacking in a few areas that I feel would greatly improve the readability of our code base, as well as providing a little extra functionality.

Javascript has no such thing as Classes, but it has several different ways to fake them. We need a clean and concise way to define and use classes, with the ability for constructors, inheritance and access to overridden methods.

John Resig posted an article a long time ago with his solution for Classes in Javascript. It's simple, but powerful, and is extremely readable, so it will form the basis of this proposal.

The Base Class

@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 7, 2024 01:27
A badass list of frontend development resources I collected over time.
@jonschlinkert
jonschlinkert / markdown-cheatsheet.md
Last active April 11, 2024 04:45
A better markdown cheatsheet.
@dominictarr
dominictarr / CYPHERLINK.md
Last active April 24, 2024 16:17
Cypherlinks