Skip to content

Instantly share code, notes, and snippets.

View groteck's full-sized avatar
:octocat:

Juan Fraire groteck

:octocat:
View GitHub Profile
@groteck
groteck / bundles.vim
Last active August 29, 2015 13:57
this is my vim config at work
" Base .vimrc file
" Installation Instructions
" 1. Place file in home directory as .vimrc
" 2. Run the following command in terminal
" mkdir .vim .vim/bundle .vim/backup .vim/swap .vim/cache .vim/undo; git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
" 3. Launch Vim and Run
" :PluginInstall
" Or from shell vim +PluginInstall +qall
" 4. Restart Vim
@groteck
groteck / test.thor
Created August 19, 2014 15:21
run protactor and middleman server
require 'net/http'
require 'thor/group'
require './lib/daemon'
class Test < Thor
include Thor::Actions
include Thor::Daemon
desc "start", "running test servers"
def start
@groteck
groteck / soft_deletable.rb
Last active August 29, 2015 14:19
soft deleted if model has associations
module SoftDeletable
extend ActiveSupport::Concern
class ModelHasAssignedValues < StandardError; end
included do
scope :deleted, ->{ where.not(deleted: true) }
scope :without_deleted, ->{ where(deleted: false) }
scope :with_deleted, ->{ unscope(where: :deleted) }
default_scope { without_deleted }
@groteck
groteck / .zshrc
Last active August 29, 2015 14:19
my zsh config file
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="pygmalion"
# Uncomment the following line to use case-sensitive completion.
@groteck
groteck / practica 1
Created February 28, 2012 21:36
aan
#include "ami.h"
#include "ami_bmp.h"
#include <stdio.h>
#include<stdlib.h>
#include<string.h>
// funcion que nos permite unir los canales de dos imagenes, separados por una línea negra de
//4 pixeles
void aan_unir_canales_unsigned_char(unsigned char *canal1, unsigned char *canal2,
unsigned char **canal_output, int width, int height){
int i,j,k;
@groteck
groteck / vim install clean
Created May 4, 2012 23:56
add sub gits repo
cd ~/.vim/
git submodule add git://github.com/nono/vim-handlebars.git bundle/handlebars
vim bundle/handlebars/example.handlebars
@groteck
groteck / workflow.md
Created November 21, 2012 12:55
github flujo de trabajo

Flujo de trabajo:

1. Crear rama:

Creamos una rama en el proyecto para nuestra funcionalidad, normalmente estas funcionalidades o tareas, se suelen asociar a un gestor de tareas (como por ejemplo Teambox, pivotaltracker, clockingit...), y suelen contener una id asi que la gente crea las ramas por ejemplo 34-add-users y asi cuando tienes muchas ramas, y en las cuales por ejemplo se podria repetir un nombre por el fallo de poner algo genérico como nombre de la rama, por ejemplo fixed-test, si quieres hacer referencia a una concreta eso es lo mejor para saber a que rama dirigirnos para revisar una tarea si nos hace falta.

2. Añade commits:

Simplemente trabaja haciendo commits en esa rama hasta terminar, para hacer memoria recordar el flujo normal de de hacer commits y subirlos a una rama en concreto: -$ git add . -$ git commit -m git push servidor rama

3. Mergeamos con master:

@groteck
groteck / sonia.rb
Created March 9, 2013 22:35
ejercicio con pacorub
#!/usr/bin/env ruby
puts "Dime tu nombre guapo"
var = gets.chomp
puts "hola #{var} yo soy Sofia"
puts "Quieres verme?"
if gets.chomp == "si"
`chromium-browser --app=http://www.wallpapergate.com/data/media/1973/Sofia_Zamolo_012.jpg`
else
puts "Las cosas conmigo tienen que ser claras pajero"
@groteck
groteck / words_count.rb
Created August 29, 2013 21:03
Use .each to iterate over the words array. For each word we find, we'll want to make the word a key in the hash and increment its value by 1. (This is why our default is 0: when we first find the word, it will have a default value of 0 that we can increment up to 1.)
#!/usr/bin/env ruby
# encoding: utf-8
puts "introduzca palabras para contarlas: "
text = gets.chomp
words = text.split
frequencies = {}
words.each do |w|
frequencies.has_key?(w) ? frequencies[w] += 1 : frequencies[w] = 1
end