Skip to content

Instantly share code, notes, and snippets.

View bernardobarreto's full-sized avatar
🚴‍♂️

Bernardo bernardobarreto

🚴‍♂️
  • 13:00 (UTC -03:00)
View GitHub Profile
@bernardobarreto
bernardobarreto / removetrailling.sh
Last active September 27, 2015 11:18
Remove trailling caracters from all ruby files in the current path
for f in $(find -name \*.rb | xargs egrep -r -l '\s+$') ; do
sed -r -i 's/\s+$//' $f ;
done
@bernardobarreto
bernardobarreto / gist:1351531
Created November 9, 2011 14:08
how to create a monitor resolution (ubuntu)
I have a monitor that its larger standard resolution is 1280x1024, but I wanted something like 1600x1100:
(In terminal)
1- To see your video exits type:
xrandr
in the exit I have VGA-1 and HDMI-0, I want to change the resolution of the HDMI
2- $ cvt 1600 1100
# 1600x1100 59.89 Hz (CVT) hsync: 68.33 kHz; pclk: 146.50 MHz
Modeline "1600x1100_60.00" 146.50 1600 1704 1872 2144 1100 1103 1113 1141 -hsync +vsync
@bernardobarreto
bernardobarreto / gist:1511675
Created December 22, 2011 20:15
Pip commands completion
#just add into your bashrc:
# pip bash completion start
_pip_completion()
{
COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \
COMP_CWORD=$COMP_CWORD \
PIP_AUTO_COMPLETE=1 $1 ) )
}
complete -o default -F _pip_completion pip
@bernardobarreto
bernardobarreto / gist:1706845
Created January 30, 2012 21:33
capture webcam video with gstreamer
$ gst-launch-0.10 v4l2src ! decodebin ! xvimagesink
@bernardobarreto
bernardobarreto / gist:2298511
Created April 4, 2012 06:16
update all your python packages via pip
# pip doesn't have a command to update all python packages yet, so you can use the code below for now
# big command right? make an alias. Oh, you maybe need to put "sudo" before "pip install"
$ (echo pip; pip freeze | awk 'BEGIN{FS="=="}{print $1}') | xargs pip install -U
@bernardobarreto
bernardobarreto / apt-fast.sh
Created April 4, 2012 06:21 — forked from gabriellima/gist:1828218
custom apt-fast (based on 0.02 by Matt Parnell)(english version)
# !/bin/sh
# CUSTOM version by Gabriel Lima (http://www.github.com/gabriellima) (@glima5)
# * Check portuguese (pt_BR) apt-get output
# * support '--force-yes' param to pass through user response
# * pass '-n10' to axel, to use 10 connections instead of default number
# * show packages installed or upgraded in the end of command execution
# apt-fast v0.02 by Matt Parnell http://www.mattparnell.com, this thing is fully open-source
# if you do anything cool with it, let me know so I can publish or host it for you
@bernardobarreto
bernardobarreto / existent_packages.sh
Created April 23, 2012 18:23
(pip) install existent package and save its name from requirements.txt
# this will try to install each package from requirements.txt
# if it succeed it'll save the package name in the existent.txt file.
# by bernardofire
while read line
do
pip install $line;
pip freeze | grep $line && echo $line >> existent.txt;
done < requirements.txt
// ==UserScript==
// @name Udacity EXT - Auto next video&quiz
// @description Udacity Extension -- Automatically go to the next video or quiz question upon reaching the end of the current one
// @namespace http://sepczuk.com/
// @version 0.2
// @include http://www.udacity.com/view*
// @match http://www.udacity.com/view*
// @copyright 2012, Damian Sepczuk, Hugo Lopes Tavares // Bernardo B. Marques
// ==/UserScript==
@bernardobarreto
bernardobarreto / gist:2877446
Created June 5, 2012 19:59 — forked from viniciusteles/gist:556029
Sete Atitudes para Hackear a Indústria de Software
Sete Atitudes para Hackear a Indústria de Software
By Klaus Wuestefeld
1) Torne-se excelente.
Seja realmente bom em alguma coisa. Não fique só choramingando ou
querendo progredir às custas dos outros. Não pense q pq vc sentou 4
anos numa faculdade ouvindo um professor falar sobre software q vc
sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo
@bernardobarreto
bernardobarreto / abed.py
Created August 29, 2012 19:21
a crawler to help abed
from splinter import Browser
class Abed(object):
def save_name(self, name):
self.open_file.write(name.encode('utf-8') + '\n')
def prepare(self):
self.browser = Browser()