Skip to content

Instantly share code, notes, and snippets.

View mthenw's full-sized avatar
🎯
Focusing

Maciej Winnicki mthenw

🎯
Focusing
View GitHub Profile
diff --git a/network.go b/network.go
index 22ea8ba..d4cbabd 100644
--- a/network.go
+++ b/network.go
@@ -10,6 +10,7 @@ import (
"github.com/dotcloud/docker/utils"
"log"
"net"
+ "os/exec"
"strconv"
#!/bin/bash
#
# git-svn-diff originally by (http://mojodna.net/2009/02/24/my-work-git-workflow.html)
# modified by mike@mikepearce.net
#
# Generate an SVN-compatible diff against the tip of the tracking branch
# Get the tracking branch (if we're on a branch)
TRACKING_BRANCH=`git svn info | grep URL | sed -e 's/.*\/branches\///'`
@EHadoux
EHadoux / Readme.md
Last active May 18, 2016 10:07
Sonar Widget for Dashing

Description

This is a dashing widget intended to show metrics from a sonar repository.

Usage

This widget currently uses the list widget as a view. You just have to add this snippet to your dashboard:

@CodeMonkeyKevin
CodeMonkeyKevin / gist:6407086
Created September 1, 2013 20:26
GoLang UUID pkgs benchmark
// github.com/nu7hatch/gouuid
BenchmarkV4 1000000 1426 ns/op
BenchmarkV5 2000000 910 ns/op
// github.com/streadway/simpleuuid
BenchmarkV5 5000000 689 ns/op
// github.com/tux21b/gocql/tree/master/uuid
BenchmarkRandomUUID 1000000 1470 ns/op
@paulirish
paulirish / gist:438326
Created June 14, 2010 21:27
10 things i learned from the jquery source
/*
.d dP"Yb 888888 88 88 88 88b 88 dP""b8 .dP"Y8
.d88 dP Yb 88 88 88 88 88Yb88 dP `" `Ybo."
88 Yb dP 88 888888 88 88 Y88 Yb "88 o.`Y8b
88 YbodP 88 88 88 88 88 Y8 YboodP 8bodP'
@swilcox
swilcox / _mgraph.md
Last active October 6, 2017 21:08
Multi-graph example widget for Shopify's Dashing dashboard

Multi-graph widget for Dashing

Description

Multi-graph widget for Shopify's dashing to display a comparison style graph (or stacked with a minor modification). Obviously, this is an example that is built heavily on the existing graph widget that is provided with dashing. This widget provides a more clear framework for expanding the graph for multiple series (or nodes) of data. After seeing the example code, it should be fairly easy to expand to 3 or more overlaid graphs (although colors might get tricky). And really, this is just a slightly greater use of the cool rickshaw graphs.

To use this widget:

@cwestin
cwestin / aggregation.js
Created November 28, 2011 19:12
Mongo shell script and sample documents used for my aggregation talks 12/2011
// make sure we're using the right db; this is the same as "use aggdb;" in shell
db = db.getSiblingDB("aggdb");
// simple projection
var p1 = db.runCommand(
{ aggregate : "article", pipeline : [
{ $project : {
tags : 1,
pageViews : 1
}}
#!/bin/sh
TRUNK_HASH=`git show-ref --hash remotes/trunk`
REV=`git svn find-rev "$TRUNK_HASH"`
if [ "$#" -eq 0 ]
then
HASHES="$TRUNK_HASH..HEAD"
else
HASHES="$1"
@ThisIsMissEm
ThisIsMissEm / handler.js
Created November 25, 2014 18:53
The better way to execute Go on Amazon Lambda (see: http://blog.0x82.com/2014/11/24/aws-lambda-functions-in-go/)
var child_process = require('child_process');
exports.handler = function(event, context) {
var proc = spawn('./test', [ JSON.stringify(event) ], { stdio: 'inherit' });
proc.on('close', function(code){
if(code !== 0) {
return context.done(new Error("Process exited with non-zero status code"));
}

Notes:

  • Text in [[ ]] are the internal libuv function call.
  • Text in {{ }} are the Node functions that are affected.
  • Text in ( ) are notes about what is happening.
  • While the Windows event loop has minor variations, I don't believe any of those affect Node.

On process.nextTick():