Skip to content

Instantly share code, notes, and snippets.

# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
@farfanoide
farfanoide / gist:6518652
Created September 11, 2013 02:23
.bashrc pa fer
# forradas de mac pa no tener problemas en un ssh a linux
export LANG="en_US.UTF-8"
export LC_COLLATE="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
export LC_MESSAGES="en_US.UTF-8"
export LC_MONETARY="en_US.UTF-8"
export LC_NUMERIC="en_US.UTF-8"
export LC_TIME="en_US.UTF-8"
export LC_ALL=
export PROMPT_DIRTRIM=2
execute "set zsh as default shell" do
command "chsh -s $(which zsh) vagrant"
end
@farfanoide
farfanoide / SetMultiLineJump
Created March 17, 2014 15:19
faster selections in visual mode
" faster selections in visual mode
let g:multi_line_jump=6
execute "vnoremap J ".g:multi_line_jump."j"
execute "vnoremap K ".g:multi_line_jump."k"
function! SetMultiLineJump(jump_size)
execute "vnoremap J ".a:jump_size."j"
execute "vnoremap K ".a:jump_size."k"
endfunction
command! -nargs=1 SetMultiLineJump call SetMultiLineJump(<f-args>)
#!/usr/bin/env bash
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Script to create a github repo and [if possible] add it as a remote
# on the current one
#
# ------------------------------------------------------------------------------
# Author
#!/usr/bin/env ruby
# encoding: utf-8
# Little script to select output source from cli.
# SwitchAudioSource must be in your PATH
# https://code.google.com/p/switchaudio-osx/
if ARGV.empty?
sources = `SwitchAudioSource -a | grep -i output`.split "\n"
sources.each_with_index { |source, index| puts "#{index}) #{source}" }
@farfanoide
farfanoide / yts.re.rb
Last active October 25, 2015 03:36
get latets yts.re movies and optionally download one or more
#!/usr/bin/env ruby
# encoding: utf-8
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Script to show last 20 torrents uploaded to yts.to and
# optionally download some of them
#
# ------------------------------------------------------------------------------
#!/usr/bin/env python
import threading
PRODUCTS = 5
CONSUMERS = 7
def use_screen(message):
if has('syntax') && !exists('g:syntax_on')
syntax enable
endif
set autoindent
set complete-=i
set smarttab " Insert tabs according to 'shiftwidth'
set number " Use normal numbers
set relativenumber " and relative line numbers
set backspace=2 " Make backspace work like most other apps
import re
data_ = re.compile('data_\w+')
day = re.compile('\d+')
month = re.compile('\w+')
data = open('feriados_crudo').readlines()
def string_to_date(string):
d = day.findall(string)
m = month.findall(day.sub('', string))