Skip to content

Instantly share code, notes, and snippets.

View twogood's full-sized avatar

David Eriksson twogood

View GitHub Profile
@twogood
twogood / import-sqlite3.py
Created November 22, 2012 14:42
ImportError: No module named _sqlite3
# import sqlite3
from pysqlite2 import dbapi2 as sqlite3
# MultiViews is evil. It automatically adds .php to /index.
Options -MultiViews
<VirtualHost *:80>
# ....
php_value auto_prepend_file /etc/apache2/local/coverage-start.php
php_value auto_append_file /etc/apache2/local/coverage-stop.php
# ....
</VirtualHost>
https://www.facebook.com/appcenter/XXXX?fb_source=dialog_permission
@twogood
twogood / gist:5676613
Last active December 17, 2015 21:39
Reset unity
dconf reset -f /org/compiz/
dconf write /org/compiz/profiles/unity/plugins/unityshell/launcher-capture-mouse false
@twogood
twogood / update-repo-from-snapshot.sh
Created August 22, 2013 13:56
Download an OpenShift snapshot and update the repository with changes made on the server. Don't forget to push afterwards!
#!/bin/sh
set -e
set -x
cd `dirname $0`
DIR=`pwd`
NAME=`basename $DIR`
SNAPSHOT_TARBALL=`mktemp --tmpdir "$NAME-XXX.tar.gz"`
rhc snapshot-save -a "$NAME" --filepath "$SNAPSHOT_TARBALL"
tar --wildcards --strip-components=5 -xvf "$SNAPSHOT_TARBALL" './*/app-root/runtime/repo/php'
git add -A php
@twogood
twogood / EnumSingleton.java
Created March 3, 2014 11:50
What do you think about this singleton pattern?
public enum EnumSingleton
{
_INSTANCE;
public static EnumSingleton of()
{
return _INSTANCE;
}
@twogood
twogood / gtk.css
Created November 10, 2014 10:08
Terminal tab colors in ~/.config/gtk-3.0/gtk.css
.notebook tab {
background-color: #c0c0c0;
color: black;
}
.notebook tab:active {
background-color: #f0f0f0;
color: black;
}
@twogood
twogood / user.php
Created February 20, 2015 08:22
Get user information from Turf API
<?php
$postdata = json_encode(array(
array('name'=>'TBIT'),
));
$opts = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-type: application/json',
@twogood
twogood / gist:209aaa495f87a5563fe3
Last active May 17, 2016 15:12
idea phpstorm ibus keyboard fix
ibus restart && sleep 1 && ibus engine xkb:se::swe