Skip to content

Instantly share code, notes, and snippets.

View desmondmorris's full-sized avatar

Desmond Morris desmondmorris

View GitHub Profile
{
"name": "dezzme",
"subdomain": "dezzme",
"scripts": {
"start": "index.js"
},
"version": "0.0.0-5",
"engines": {
"node": "v0.6.x"
},
app.router.get('/:slug', function (slug) {
Shortlink.find( {slug: slug} , function (err, shortlink) {
if (err) { throw new(Error)(err) }
console.log( this.req ); // This returns "undefined" and I think I understand why.
// How do I access request and response objects from within
// an anon callback like this one?
});
});
@desmondmorris
desmondmorris / gist:2814275
Created May 27, 2012 13:50
Terms for current node View
$view = new view;
$view->name = 'terms';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'Terms';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
@desmondmorris
desmondmorris / gist:2902584
Created June 9, 2012 21:02
Card Bounce - Desmond, Steve, Sam
<html>
<head>
<title>Canvas example</title>
<style>
body {
margin:0;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
{
"name": "dezzme",
"subdomain": "dezzme",
"scripts": {
"start": "app.js"
},
"version": "0.0.0-17",
"engines": {
"node": "v0.6.x"
},
@desmondmorris
desmondmorris / fuel.py
Created December 19, 2012 13:13 — forked from NorthIsUp/fuel.py
# blog post explaining all of this coming soon.
import requests
from pprint import pprint
try:
import simplejson as json
except ImportError:
import json
@desmondmorris
desmondmorris / gist:5832414
Last active December 18, 2015 19:19
MongoDB NYC 2013 - Replica Sets

REPLICA SETS

HIDDEN - Reporting, Backup with out affecting the actual dataset

ROLES

Arbiter - low resource, voting member

// Highest priority always wins

@desmondmorris
desmondmorris / wercker.yml
Last active December 20, 2015 06:49
Drupal 7 - Wercker configuration
box: wercker/php
services:
- wercker/mysql
build:
steps:
- script:
name: Install Drush
code: |-
pear channel-discover pear.drush.org
pear install drush/drush
@desmondmorris
desmondmorris / gist:8139060
Created December 26, 2013 21:40
Drupal export for tumblr
SELECT
'text' as type,
'published' as state,
'off' as tweet,
FROM_UNIXTIME(n.created) as 'date',
'html' as format,
REPLACE(a.alias, 'blog/','') as slug,
n.title,
b.body_value as body
FROM node n
@desmondmorris
desmondmorris / nginx-vhost.sh
Created January 2, 2014 21:30
Automatically creating new virtual hosts with Nginx
# Script by: Seb Dangerfield - sebdangerfield.me.uk
# http://www.sebdangerfield.me.uk/2011/03/automatically-creating-new-virtual-hosts-with-nginx-bash-script/
NGINX_CONFIG='/etc/nginx/sites-available'
NGINX_SITES_ENABLED='/etc/nginx/sites-enabled'
WEB_DIR='/var/www'
SED=`which sed`
CURRENT_DIR=`dirname $0`
if [ -z $1 ]; then
echo "No domain name given"