Skip to content

Instantly share code, notes, and snippets.

View dscape's full-sized avatar

Nuno Job dscape

View GitHub Profile
(:: 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 / 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 ..
@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
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'); }
new RegExp(
[
'<',
'(/?)', // 2 - is closing
'([-:\\w]+)', // 3 - name
'((?:\\s+[-\\w]+(?:', '=', '(?:' +
'\\w+|' +
'"[^"]*"|' +
'\'[^\']*\'))?)*)', // 4 - attributes
'(/?)', // 5 - is self-closing
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',
@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
function f() {
throw new Error('def');
}
process.on('uncaughtException', function(e) {
console.log('uncaught exception', e);
f();
});
f();
We couldn’t find that file to show.

Auto CDN Idea

Look at our apps and see if they have static files. If they do, put them in a CDN and magically link the static files to that CDN, by either changing the source or any other means