Skip to content

Instantly share code, notes, and snippets.

View andreibosco's full-sized avatar

Andrei Bosco B. Torres andreibosco

View GitHub Profile
@andreibosco
andreibosco / gist:5930045
Created July 4, 2013 20:24
substituir git:// por https://
Fonte: http://stackoverflow.com/questions/4891527/git-protocol-blocked-by-company-how-can-i-get-around-that
Simply issue the following command:
git config --global url."https://".insteadOf git://
This simply adds the following two lines to ~/.gitconfig:
[url "https://"]
insteadOf = git://
@andreibosco
andreibosco / gist:5977665
Created July 11, 2013 17:54
desabilitando efeitos jQuery para testes (RSpec, Selenium, Cucumber)
Fonte: http://blog.crowdint.com/2011/04/13/turn-jquery-effects-off-for-testing.html
The usual, we use RSpec for TDD, we use Cucumber for BDD, although lately, I've been using Steak in place of Cucumber and so far I am loving it.
When you are using Capybara + Selenium for testing with Cucumber or Steak, sometimes you can get an error when you write tests for clicks that are followed by an animation.
For example:
scenario "New resource" do
click_link 'New Resource'
@andreibosco
andreibosco / gist:5985119
Last active December 19, 2015 16:39
Passo a passo de instalação do EDX no ubuntu server 12.04
  • Atualizar sistema
    • apt-get update
    • apt-get upgrade
  • Instalar scypi
    • apt-get install python-numpy python-scipy
  • Instalar git
    • apt-get install git
  • Configurar git para utilizar https:// no lugar de git:// (devido a bloqueio de firewall)
    • git config --global url."https://".insteadOf git://
  • Clonar projeto do EDX
@andreibosco
andreibosco / gist:5987841
Last active December 19, 2015 16:59
Passo a passo de instalação do EDX no CentOS 6.4
  • atualizar sistema
    • utilizei a ferramenta gráfica para atualizar os pacotes instalados
  • instalar scypi, numpy e git
    • yum install scypi
    • yum install numpy
    • yum install git
  • Configurar git para utilizar https:// no lugar de git:// (devido a bloqueio de firewall)
    • git config --global url."https://".insteadOf git://
  • Clonar projeto do EDX
  • git clone https://github.com/edx/edx-platform.git
@andreibosco
andreibosco / gist:6131141
Created August 1, 2013 13:08
Desfazer ultimo commit do git (que ainda não foi enviado ao servidor)
git reset --soft HEAD~1
@andreibosco
andreibosco / gist:6131142
Created August 1, 2013 13:08
Desfazer ultimo commit do git (que ainda não foi enviado ao servidor)
git reset --soft HEAD~1
@andreibosco
andreibosco / gist:6231295
Created August 14, 2013 13:56
Definir locale no osx
Fonte: http://stackoverflow.com/questions/7165108/in-osx-lion-lang-is-not-set-to-utf8-how-fix
I noticed the exact same issue when logging onto servers running Red Hat from an OSX Lion machine.
Try adding or editing the ~/.profile file for it to correctly export your locale settings upon initiating a new session.
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
These two lines added to the file should suffice to set the locale [replace en_US for your desired locale, and check beforehand that it is indeed installed on your system (locale -a)].
@andreibosco
andreibosco / gist:6360989
Created August 28, 2013 01:07
convertendo video em sequencia de imagens

Utilizando ffmpeg

ffmpeg -r 30 -i Video.mpg Pictures%d.jpg

  • -r framerate
  • -i arquivo de entrada

Utiliando mplayer

mplayer inputfile -vo png:z=8 -endpos 5 -ao null

@andreibosco
andreibosco / gist:6949474
Last active December 25, 2015 08:49
One Page Scroll with arrow keys

For all those interested in the scroll-effect, as well as those with concerns that the arrows/page down key don't work (laptops): First, you can click the pagination buttons.

But that's not fun. Here's the fix to make the arrows/page-keys work like they should:

First, this is a super easy plugin to use with jQuery. The developer is really, REALLY talented, I highly recommend you check out his main website.

Here's the dev's plugin: One Page Scroll

Here's the code used to initialize it in the ready() function:

@andreibosco
andreibosco / gist:7071673
Created October 20, 2013 16:13
cedilla (cedilha) no Ubuntu

Fonte

O cedilha não funciona ao utilizar o Gnome ou KDE no Ubuntu em inglês com um teclado americano.

Se a língua padrão do sistema for alterada para português do Brasil, o cedilha funcionará automaticamente. Para tal, vá ao menu System / Administration / Languages Support e mude o padrão para português.

Se você quer manter o inglês como língua padrão, siga os passos abaixo.

Selecione o layout de teclado chamado USA Alternative International (former us_intl) em System / Preferences / Keyboard / Layouts.
Edite o arquivo: libgtk2.0-0.immodules: