Skip to content

Instantly share code, notes, and snippets.

Javier Blanco Gutiérrez jbgutierrez

Block or report user

Report or block jbgutierrez

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gitgutter.patch
diff --git a/autoload/gitgutter/utility.vim b/autoload/gitgutter/utility.vim
index cecc887..62512d4 100644
--- a/autoload/gitgutter/utility.vim
+++ b/autoload/gitgutter/utility.vim
@@ -124,7 +124,15 @@ function! gitgutter#utility#file_relative_to_repo_root()
endfunction
function! gitgutter#utility#command_in_directory_of_file(cmd)
- return 'cd ' . gitgutter#utility#shellescape(gitgutter#utility#directory_of_file()) . ' && ' . a:cmd
+ let cmd = 'cd ' . gitgutter#utility#shellescape(expand('%:p:h')) . ' && ' . a:cmd
View walker-benchmarking.coffee
#!/usr/bin/env coffee
coffeeWalk = (category, id) ->
category.selected = category.id is id
for subcategory in category.subcategories
coffeeWalk subcategory, id
category.selected or= subcategory.selected
# var coffeeWalk = function(category, id) {
# var i = 0, subcategories = category.subcategories, len = subcategories.length, subcategory;
@jbgutierrez
jbgutierrez / README.md
Last active Aug 29, 2015
Little python script to help you cheat at double candy game.
View README.md

#Prerequisites#

  • iPhone
  • Yosemite OSX
  • opencv

#Steps#

  1. Attach your iphone to your mac
  2. Open QuickTime and start a New Movie Recording
@jbgutierrez
jbgutierrez / plot-graphviz.rb
Last active Aug 29, 2015
Plotting a dependency graph
View plot-graphviz.rb
#!/usr/bin/env ruby
# coding: UTF-8
require 'yaml'
ALIAS = {
text: '/vendor/requirejs-text/text',
jquery: '/vendor/jquery/dist/jquery',
dust: '/vendor/dustjs-linkedin/dist/dust-full',
dustHelpers: '/vendor/dustjs-linkedin-helpers/dist/dust-helpers',
pagejs: '/vendor/page.js/page',
@jbgutierrez
jbgutierrez / refactor.coffee
Last active Aug 29, 2015
Colaborative function patches
View refactor.coffee
Function::patch = (binding, fn) ->
unless fn
fn = binding
binding = @
wrapped = (args...) ->
args.unshift (args...) ->
wrapped.previous.apply binding, args
fn.apply binding, args
wrapped.previous = @
wrapped
@jbgutierrez
jbgutierrez / Gemfile
Last active Aug 29, 2015
Hodgepodge of useful scripts to analize different compression tools
View Gemfile
# A sample Gemfile
source "https://rubygems.org"
gem "sinatra"
gem "mongoid"
gem "bson_ext"
gem 'sinatra-reloader'
gem 'haml'
@jbgutierrez
jbgutierrez / chart-pie-from-zsh_history.rb
Created Sep 3, 2014
Distribution of hours spent typing commands at my zsh shell each day
View chart-pie-from-zsh_history.rb
#!/usr/bin/env ruby
# coding: UTF-8
require 'pathname'
require 'googlecharts'
file = Pathname.new 'zsh_history'
dates = {}
file.each_line do |line|
next unless line =~ /^: /
@jbgutierrez
jbgutierrez / SpotsManager.py
Last active Aug 29, 2015
Using sublime quick panel and hooks to retrieve/save content from an external ruby script (Sublime Plugin)
View SpotsManager.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sublime, sublime_plugin
import tempfile, subprocess, collections
DEBUG_MODE = False
IS_OSX = sublime.platform() == 'osx'
settings = sublime.load_settings('SpotsManager.sublime-settings')
@jbgutierrez
jbgutierrez / ExtractProperty.vim
Created May 6, 2014
Shortcut to send translation tokens to an external properties file
View ExtractProperty.vim
function! ExtractProperty()
let a_save = @a
try
let properties_file = expand('%:r').'.properties'
if filereadable(properties_file)
normal! gv"ay
let value = @a
let key = substitute(value, ".*", "\\U\\0", "")
let key = substitute(key, '\W\+', "_", "g")
if len(key) > 20
@jbgutierrez
jbgutierrez / setup-continuous-deployment-ubuntu-12.10-x86_64.sh
Last active Dec 27, 2015
Self-contained bash script to setup continuous deployment for nodejs apps built on top of ubuntu, git and foreman
View setup-continuous-deployment-ubuntu-12.10-x86_64.sh
DEPLOYER='deployer'
DEPLOYER_HOME="/home/$DEPLOYER"
PROJECT_NAME='node-js-sample'
PROJECT_REPO='https://github.com/heroku/node-js-sample.git'
# Provisining an ubuntu server
apt-get -y update
apt-get -y upgrade
apt-get -y install software-properties-common
add-apt-repository ppa:chris-lea/node.js
You can’t perform that action at this time.