Skip to content

Instantly share code, notes, and snippets.

View dscape's full-sized avatar

Nuno Job dscape

View GitHub Profile
function f() {
throw new Error('def');
}
process.on('uncaughtException', function(e) {
console.log('uncaught exception', e);
f();
});
f();
@dscape
dscape / git-commit-prefixes
Created February 17, 2012 10:41 — forked from indexzero/git-commit-prefixes
Short list of Git commit prefixes used at Nodejitsu
[api]: New apis / changes to apis
[test]: Update test/* files
[dist]: Changes to submodules, version bumps, updates to package.json
[minor]: Small changes
[doc]: Updates to documentation
[ux]: Updates to UX
[fix]: Bug fixes
[bin]: Update binary scripts associated with the project
[merge]: Resolved git merge from upstream or otherwise
[refactor]: Refactor of existing code with no external API changes
var url_parts = url.parse(req.url, true);
var query1 = url_parts.query;
// Build the post string from an object
var query=querystring.stringify(query1);
var post_options = {
host: 'steamcommunity.com',
port: '443',
new RegExp(
[
'<',
'(/?)', // 2 - is closing
'([-:\\w]+)', // 3 - name
'((?:\\s+[-\\w]+(?:', '=', '(?:' +
'\\w+|' +
'"[^"]*"|' +
'\'[^\']*\'))?)*)', // 4 - attributes
'(/?)', // 5 - is self-closing
var oauth = require('oauth')
, request = require('request')
;
module.exports = function(app, params, cb) {
if(!params.consumer_key) { throw new Error('Please provide a consumer key.'); }
if(!params.consumer_secret) { throw new Error('Please provide a consumer secret.'); }
if(!params.callback_url) { throw new Error('Please provide callback url.'); }
if(!cb) { throw new Error('Please provide a callback'); }
@dscape
dscape / make-node.sh
Created November 9, 2011 00:06
Make nodejs with github.com kennethreitz osx-gcc-installer instead of xcode failing
dscape at air in ~/Desktop/node/node on (no branch)
$ ./configure
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for program gcc or cc : /usr/bin/gcc
Checking for gcc : ok
Checking for library dl : yes
@dscape
dscape / sup
Created September 20, 2011 12:04
Sensor updater
#!/bin/bash
# Sensor updater
# v0.1
echo "==> Updating sensor-tracking"
cd sensor-tracking
git pull origin
cd ..
(:: Configure script for the top-songs application ::)
(: forest :)
xquery version "1.0-ml";
import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy";
let $config := admin:get-configuration()
let $config := admin:forest-create(
$config,
"top-songs-01",
xdmp:host(),
())
@dscape
dscape / nodemailer-to-postmark.js
Created August 3, 2011 16:16
Make the postmark api look like node_mailer
var request = require('request')
, _ = require('underscore');
function send_mail(message, callback) {
if(typeof exports.SMTP.api_key !== "string") {
console.log(exports.SMTP)
callback(new Error("No API Key was given"));
return;
}
if(typeof exports.SMTP !== "object") {
@dscape
dscape / apr28.md
Created April 28, 2011 07:39
Meetup tomorrow

#sfodocdb drinks tomorrow.

Place: RickHouse - 246 Kearny St. SF, CA 94108 Time: 8PM

  • People: @csanz, @nitin, @janl, @dscape, @johndmitchell
  • Maybe: @mikeal, @jchris, @scissorjammer, @tilgovi, @hunterhacker
  • No: @hackingdata