Skip to content

Instantly share code, notes, and snippets.

View kuno's full-sized avatar

kuno kuno

View GitHub Profile
@kuno
kuno / es.txt
Created September 11, 2012 07:58 — forked from karussell/Query-DSL-elasticsearch.txt
Bird's Eye View on ElasticSearch its Query DSL
Several times in a month there pop up questions regarding query structure on the ElasticSearch user group.
Although there are good docs explaining this in depth probably the bird view of the Query DSL is necessary to
understand what is written there. There is even already some good external documentation available:
http://www.elasticsearch.org/tutorials/2011/08/28/query-dsl-explained.html
And there were attempts to define a schema:
http://groups.google.com/group/json-schema/browse_thread/thread/ae498ee818155d50
https://gist.github.com/8887766ca0e7052814b0
@kuno
kuno / promises.md
Created October 22, 2012 16:21 — forked from domenic/promises.md
You're Missing the Point of Promises

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
    // the rest of your code goes here.
});
@kuno
kuno / .vimrc
Created November 10, 2012 12:41 — forked from isaacs/.vimrc
set list listchars=tab:\ \ ,trail:·
@kuno
kuno / app.js
Created November 15, 2012 14:09 — forked from pixelhandler/app.js
Develop a RESTful API Using Node.js With Express and Mongoose - See: http://pixelhandler.com/blog/2012/02/09/develop-a-restful-api-using-node-js-with-express-and-mongoose/
var application_root = __dirname,
express = require("express"),
path = require("path"),
mongoose = require('mongoose');
var app = express.createServer();
// database
mongoose.connect('mongodb://localhost/ecomm_database');
@kuno
kuno / source_maps.rb
Created November 20, 2012 05:20 — forked from alexspeller/source_maps.rb
Coffeescript Source Maps in Rails
# config/initializers/source_maps.rb
if Rails.env.development?
require 'open3'
module CoffeeScript
class SourceMapError < StandardError; end;
class << self
def map_dir
@kuno
kuno / gist:4251236
Created December 10, 2012 15:25 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@kuno
kuno / es.sh
Created March 20, 2013 06:14 — forked from sgringwe/es.sh
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
# Download the compiled elasticsearch rather than the source.
wget http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.5.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
sudo mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
@kuno
kuno / pi.diff
Created March 29, 2013 14:49 — forked from davecheney/pi.diff
diff -r d2213960ade2 src/cmd/5l/asm.c
--- a/src/cmd/5l/asm.c Sat Jul 14 15:59:52 2012 +0400
+++ b/src/cmd/5l/asm.c Sun Jul 15 19:45:39 2012 +1000
@@ -33,6 +33,7 @@
#include "l.h"
#include "../ld/lib.h"
#include "../ld/elf.h"
+#include "../ld/dwarf.h"
static Prog *PP;
var zmq = require('zmq');
function Majordomo(options)
{
this.requests = zmq.socket('router');
this.requests.identity = 'majordomo:incoming:' + process.pid;
this.responders = zmq.socket('dealer');
this.responders.identity = 'majordomo:outgoing:' + process.pid;
if (options)
this.configure(options);
// Named constants with unique integer values
var C = {};
// Tokenizer States
var START = C.START = 0x11;
var TRUE1 = C.TRUE1 = 0x21;
var TRUE2 = C.TRUE2 = 0x22;
var TRUE3 = C.TRUE3 = 0x23;
var FALSE1 = C.FALSE1 = 0x31;
var FALSE2 = C.FALSE2 = 0x32;
var FALSE3 = C.FALSE3 = 0x33;