Skip to content

Instantly share code, notes, and snippets.

@lrhache
lrhache / install.sh
Last active August 29, 2015 13:58
PyQt in virtualenv
mkdir lib
cd lib
wget http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.10.4/PyQt-x11-gpl-4.10.4.tar.gz
tar xvf PyQt-x11-gpl-4.10.4.tar.gz
cd PyQt-x11-gpl-4.10.4/
python configure.py
make && make install
@lrhache
lrhache / install
Last active August 29, 2015 13:57
neo4j install
mkdir ~/neo4j
mv neo4j-community-2.0.1-unix.tar.gz ~/neo4j/neo4j-community-2.0.1-unix.tar.gz
cd ~/neo4j
tar -xzf neo4j-community-2.0.1-unix.tar.gz
cp neo4j-community-2.0.1 <graph-name>
git clone git://github.com/neo4j/spatial.git spatial
cd spatial
mvn clean package -Dmaven.test.skip=true install
unzip target/neo4j-spatial-0.11-SNAPSHOT-server-plugin.zip -d ~/neo4j/<graph-name>/plugins/
~/neo4j/<graph-name>/bin/neo4j start
@lrhache
lrhache / heroku-set-configs-from-file.md
Created December 11, 2013 15:21
Easy way to batch set Heroku config from a file. No one wants to do this manually(!?).

#Heroku set configs from files

  • Export your configs from Heroku in "shell" format to file:

    $ heroku config -a <app_name> -s > .env-<environment_name(production, staging, ...)>
    
  • Copy this script to a file

@lrhache
lrhache / python-selenium-open-tab.md
Last active August 31, 2025 04:02
Python Selenium - Open new tab / focus tab / close tab

On a recent project, I ran into an issue with Python Selenium webdriver. There's no easy way to open a new tab, grab whatever you need and return to original window opener.

Here's a couple people who ran into the same complication:

So, after many minutes (read about an hour) of searching, I decided to do find a quick solution to this problem.

@lrhache
lrhache / heroku_stop_processes.md
Last active December 26, 2015 22:19
Command line helper to find and stop all manually initiated process on Heroku.

One of my automated process starts dynos when he feels he need more juice in the pipes. But, while running tests, something failed and just kept 10 or more dynos running. It's a pain to stop those manually.

Here's a simple command line that can be executed to stop all running dynos except those initiated at runtime or in via the Procfile.

heroku ps -a <HEROKU_APP> | grep -o -P '(run\.[0-9]+)' | while read line ; do heroku ps:stop $line -a <HEROKU_APP> ; done