Skip to content

Instantly share code, notes, and snippets.

View gist:20561d3c49522eab2b689185b425e4ae
#!/bin/sh
# download
wget http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.4.zip
# unzip and start
unzip elasticsearch-0.20.4.zip
cd elasticsearch-0.20.4
# remove data in case you have defined some analyzers in the past (e.g. stop/start)
rm -rf data/
View Gemfile
source 'https://rubygems.org'
gem 'gooddata'
gem 'json'
gem 'pmap'
View .travis.yml
language: node_js
node_js:
- '0.10'
install: npm run dev_install
env:
global:
secure: CODECLIMATE_TOKEN
View traceroute.hs
#!/usr/bin/env runhaskell
-- Haskell traceroute over icmp
import Control.Monad
import Data.Bits(complement)
import Data.Char (chr,ord)
import Data.List
import Data.Monoid
import Data.Time
View ember.select2.js
// Select box utilizing Select2 functionality that overrides Ember.Select;
// Define view in the same way that you would an Ember.Select view.
// Additional attributes supported are: width, allowClear, and closeOnSelect;
// Example view:
// {{ view App.Select2
// viewName="fieldValueSelect2"
// prompt="Please select a value list"
// contentBinding="controller.fieldValuesLists"
// optionLabelPath="content.name"
// optionValuePath="content.id"
View nginx.conf
#don't send the nginx version number in error pages and Server header
server_tokens off;
# config to enable HSTS(HTTP Strict Transport Security) https://developer.mozilla.org/en-US/docs/Security/HTTP_Strict_Transport_Security
# to avoid ssl stripping https://en.wikipedia.org/wiki/SSL_stripping#SSL_stripping
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
# config to don't allow the browser to render the page inside an frame or iframe
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri
View Gruntfile.js
module.exports = function(grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
meta : {
// Specify where our test files are. Once we get all the tests switched over we can use 'test/js/**/*.spec.js' to automatically load all tests.
specs : ['test/js/src/**/*.spec.js'],
bin : {
coverage: 'js/bin/coverage'
@korczis
korczis / pagination_support.js
Created Sep 25, 2012
Ember.PaginationSupport
View pagination_support.js
var get = Ember.get;
/**
@extends Ember.Mixin
Implements common pagination management properties for controllers.
*/
Ember.PaginationSupport = Ember.Mixin.create({
/**
*/
@korczis
korczis / proxy.js
Created Mar 9, 2012 — forked from steadicat/proxy.js
A reverse-proxy for CouchDB written in Node.js
View proxy.js
#!/usr/local/bin/node
var sys = require('sys');
var http = require('http');
var url = require('url');
var PREFIX = '/db/';
var TARGET = 'http://example.cloudant.com';
var PORT = 8001;