I hereby claim:
- I am alejandrodumas on github.
- I am alejandrodumas (https://keybase.io/alejandrodumas) on keybase.
- I have a public key ASCiBrs8swP870jCrUIQmyWlM52aZRuBkr8HbSWxRQG-EAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#!/bin/bash | |
# by http://github.com/jehiah | |
# this prints out some branch status (similar to the '... ahead' info you get from git status) | |
# example: | |
# $ git branch-status | |
# dns_check (ahead 1) | (behind 112) origin/master | |
# master (ahead 2) | (behind 0) origin/master | |
git for-each-ref --format="%(refname:short) %(upstream:short)" refs/heads | \ |
curl -XPUT localhost:9200/test -d ' | |
{"settings": { | |
"analysis" :{ | |
"analyzer": { | |
"exact_analyzer": { | |
"type": "custom", | |
"tokenizer":"my_pattern_tokenizer", | |
"filter":[] | |
} | |
}, |
# <%= google_analytics 'UA-XXXXXX-XX' %> | |
# </body> | |
# application_helper.rb | |
def google_analytics(id = nil) | |
content_tag(:script, :type => 'text/javascript') do | |
"var _gaq = _gaq || []; | |
_gaq.push(['_setAccount', '#{id}']); | |
_gaq.push(['_trackPageview']); |
#!/usr/bin/env ruby | |
require 'fileutils' | |
require 'rubygems' | |
gem_dirs = [] | |
basedir = 'deps' | |
FileUtils.mkdir_p(basedir) | |
ARGV.each do |gemset| |
# An example of using ngram analysis in ElasticSearch with the Tire rubygem | |
# ========================================================================== | |
# The original, raw example: https://gist.github.com/988923 | |
require 'rubygems' | |
require 'tire' | |
require 'yajl/json_gem' | |
class URL | |
def initialize(attributes={}) |
# ======================================== | |
# Testing n-gram analysis in ElasticSearch | |
# ======================================== | |
curl -X DELETE localhost:9200/ngram_test | |
curl -X PUT localhost:9200/ngram_test -d ' | |
{ | |
"settings" : { | |
"index" : { | |
"analysis" : { |
The following rules of programming style are excerpted from the book "The Elements of Programming Style" by Kernighan and Plauger, published by McGraw Hill. Here is quote from the book: "To paraphrase an observation in The Elements of Style by Strunk and White, the rules of programming style, like those of English, are sometimes broken, even by the best writers. When a rule is broken, however, you will usually find in the program some compensating merit, attained at the cost of the violation. Unless you are certain of doing as well, you will probably do best to follow the rules."
#!/usr/bin/env python | |
import os | |
import re | |
import subprocess | |
import sys | |
modified = re.compile('^(?:M|A)(\s+)(?P<name>.*)') | |
CHECKS = [ |