Skip to content

Instantly share code, notes, and snippets.

View alejandrodumas's full-sized avatar
💻

Ezequiel Erbaro alejandrodumas

💻
  • Buenos Aires, Argentina
View GitHub Profile

Keybase proof

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:

@alejandrodumas
alejandrodumas / git-branch-status
Created October 31, 2012 00:58 — forked from jehiah/git-branch-status
show git ahead/behind info for branches
#!/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":[]
}
},
@alejandrodumas
alejandrodumas / gist:2004905
Created March 9, 2012 03:44 — forked from daz/gist:818065
Google Analytics Rails helper
# <%= 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|
@alejandrodumas
alejandrodumas / ngrams-and-tire.rb
Created December 26, 2011 01:48 — forked from karmi/ngrams-and-tire.rb
An example of using ngram analysis in ElasticSearch with the Tire rubygem
# 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" : {
@alejandrodumas
alejandrodumas / elements.md
Created November 18, 2011 19:03 — forked from soveran/elements.md
Excerpts from The Elements of Programming Style. The source of this compilation is unknown.

The Elements of Programming Style

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."

@alejandrodumas
alejandrodumas / pre-commit
Created November 16, 2011 19:47 — forked from spulec/pre-commit
Yipit Pre-commit Hook
#!/usr/bin/env python
import os
import re
import subprocess
import sys
modified = re.compile('^(?:M|A)(\s+)(?P<name>.*)')
CHECKS = [