Skip to content

Instantly share code, notes, and snippets.

@wookiehangover
wookiehangover / gist:3266276
Created August 5, 2012 17:51
Uploads Formidable file objects to S3, save to redis
// Uploads Formidable file objects to S3, save to redis
//
// TODO - add image processing task
var fs = require('fs');
var s3 = require('knox').createClient();
var redis = require('redis');
var client = redis.createClient();
function update( data, cb ){
@kordless
kordless / gauges.js
Created October 9, 2012 16:29
guag.es tracker code
var _gauges = _gauges || [];
(function () {
var h = (_gauges['slice']) ? _gauges.slice(0) : [];
_gauges = {
track_referrer: true,
image: new Image(),
track: function () {
this.setCookie('_gauges_cookie', 1, 1);
var a = this.url();
if (a) {
@jonschlinkert
jonschlinkert / markdown-cheatsheet.md
Last active April 23, 2025 17:58
A better markdown cheatsheet.
@howar31
howar31 / Markdown_Cheatsheet.md
Last active July 24, 2023 07:43
Markdown Cheatsheet
@kneath
kneath / growth.md
Last active November 12, 2018 06:33
Growth position

Hack on github.com with me

Thanks everyone! I've got enough leads for the time being.

@ebidel
ebidel / Web Components Resources.md
Last active October 12, 2024 17:10
List of resources related to Web Components
@stongo
stongo / app.js
Last active September 7, 2024 14:28
Joi validation in a Mongoose model
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/test');
var db = mongoose.connection;
db.on('error', function() {
return console.error.bind(console, 'connection error: ');
});
@benmj
benmj / geocoder-service.js
Created August 29, 2013 16:38
An AngularJS Service for intelligently geocoding addresses using Google's API. Makes use of localStorage (via the ngStorage package) to avoid unnecessary trips to the server. Queries Google's API synchronously to avoid `google.maps.GeocoderStatus.OVER_QUERY_LIMIT`
/*global angular: true, google: true, _ : true */
'use strict';
angular.module('geocoder', ['ngStorage']).factory('Geocoder', function ($localStorage, $q, $timeout) {
var locations = $localStorage.locations ? JSON.parse($localStorage.locations) : {};
var queue = [];
// Amount of time (in milliseconds) to pause between each trip to the
@tekiegirl
tekiegirl / uniqueId.adoc
Last active March 24, 2021 20:54
Using the graph to control unique id generation.

Using the graph to control unique id generation

Introduction

This gist was prompted by Nigel Small’s tweet of a query to generate a unique id for a node (and is posted here with his agreement). It inspired me to think about how it could be used in a full example, unrestricted by Twitter’s 140 characters. I have also looked at how we could generate different sets of unique ids for different labels.

Auto-incrementing #Neo4j counter MERGE (x:Counter {name:'foo'}) ON CREATE SET x.count = 0 ON MATCH SET x.count = x.count + 1 RETURN x.count

— Nigel Small (@technige) December 16, 2013