Skip to content

Instantly share code, notes, and snippets.

@tanepiper
tanepiper / twitter_oauth_getter.js
Created September 11, 2010 16:14
A small command line nodejs script for doing Twitter OAuth.
#!/usr/bin/env node
var argv = require('optimist')
.usage('Usage: --key=[consumer key] -secret=[consumer secret]')
.demand(['key', 'secret'])
.argv
;
var OAuth = require('oauth').OAuth;
var Step = require('step');
@gre
gre / EasingFunctions.json
Last active January 11, 2023 10:28
DEPRECATED Please use http://github.com/gre/bezier-easing for latest vrrsion.
{
"ease": [0.25, 0.1, 0.25, 1.0],
"linear": [0.00, 0.0, 1.00, 1.0],
"ease-in": [0.42, 0.0, 1.00, 1.0],
"ease-out": [0.00, 0.0, 0.58, 1.0],
"ease-in-out": [0.42, 0.0, 0.58, 1.0]
}
@shime
shime / _readme.md
Last active April 28, 2023 18:56
github oauth in node using express

What?

Most basic example of authenticating with Github in node.

How?

Clone this gist, change keys inside config.js and then hit npm install && node app.js.

Done?

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>imgur oauth</title>
<script src="http://code.jquery.com/jquery.min.js"></script>
<script>
$(function () {
var extractToken = function(hash) {
@robotlolita
robotlolita / purr.md
Last active May 10, 2017 20:39
Why Purr is awful

You appear to be advocating a new:

  • functional
  • imperative
  • object-oriented
  • procedural
  • stack-based
  • "multi-paradigm"
  • lazy
  • eager
  • statically-typed
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@kentbrew
kentbrew / abandon_all_hope.md
Last active April 22, 2018 06:17
Signing a Self-Hosted Auto-Updating Firefox Extension under the New Regime

Signing a Self-Hosted Auto-Updating Firefox Extension under the New Regime

I run a self-hosted auto-updating Firefox add-on being used by several million people. I am informed that I will need to "sign" it soon or it will quit working. (Deadlines are unclear; it seems like it may be as soon as June 30th.) I am looking for exact instructions as to how to make this happen.

I am not finding these instructions, so I am doing my best to puzzle things out.

Googling for things like "how to sign a firefox add-on" get me a lot of false leads. Mozilla should take down or at least modify these pages with current information:

https://developer.mozilla.org/en-US/docs/Signing_a_XPI

https://developer.mozilla.org/en-US/docs/Signing_an_extension

###Javascript Patterns ..thx @ Sorella

####Composition

function compose() {
  var traits = [].slice.call(arguments)
  return traits.reduce(function(result, trait) {
    for (var k in trait) 
@joepie91
joepie91 / getting-started.md
Last active February 21, 2024 14:45
Getting started with Node.js

"How do I get started with Node?" is a commonly heard question in #Node.js. This gist is an attempt to compile some of the answers to that question. It's a perpetual work-in-progress.

And if this list didn't quite answer your questions, I'm available for tutoring and code review! A donation is also welcome :)

Setting expectations

Before you get started learning about JavaScript and Node.js, there's one very important article you need to read: Teach Yourself Programming in Ten Years.

Understand that it's going to take time to learn Node.js, just like it would take time to learn any other specialized topic - and that you're not going to learn effectively just by reading things, or following tutorials or courses. _Get out there and build things!

@hagb4rd
hagb4rd / babel-ecma2015-cdn.html
Last active June 4, 2016 15:28
HTML-Templates
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex, nofollow">
<meta name="googlebot" content="noindex, nofollow">
<meta name="author" content="kasia99@gmx.de">