This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common | |
sudo apt-get build-dep vim-gnome | |
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev mercurial libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev | |
sudo rm -rf /usr/local/share/vim | |
sudo rm /usr/bin/vim | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# Tested on Ubuntu 14.04 with Opera Developer 25 Bookmarks file and imported successfully to Google Chrome. | |
# Opera developer folder in Ubuntu 14.04: ~/.config/opera-developer. See Opera About dialog for other OSes. | |
# The JSON file that we have to parse is in /$OPERA_FOLDER/Bookmarks | |
# Usage: php opera25_to_html_bookmarks.php Bookmarks output_file.html | |
if( count($argv) != 3 ) echo "Usage: php opera25_to_html_bookmarks.php Bookmarks output_file.html\n\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example file (GTK3 VERSION): https://wiki.gnome.org/Projects/Vala/CairoSample#Shaped_Window_Example | |
# My system had no default -lm addition with valac, options are: | |
# 1. Directly compiling with valac passing compiler linker flags: | |
valac -X -lm --pkg gtk+-3.0 --pkg cairo --pkg gdk-3.0 cairo-shaped.vala | |
# 2. Using valac to generate .c and compile | |
valac -C --pkg gtk+-3.0 --pkg cairo --pkg gdk-3.0 cairo-shaped.vala | |
gcc cairo-shaped.vala `pkg-config glib-2.0 --cflags --libs` `pkg-config gtk+-3.0 --cflags --libs` `pkg-config gdk-3.0 --cflags --libs` -lm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sort folders/files by disk usage | |
du -hc . | grep [.]/[^/]*$ | sort -h | |
# replace in all files | |
grep -rl matchstring somedir/ | xargs sed -i 's/string1/string2/g' | |
# script to rename in all files: | |
#!/usr/bin/env bash | |
if [ $# -ne 3 ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local glfw = require("glfw3") --Let's say we have a magic GLFW3 binding there! | |
local openGL = require("opengl") | |
openGL.loader = glfw.GetProcAddress | |
openGL:import() | |
--and somewhere else | |
local vbo = ffi.new("GLuint[1]") | |
gl.GenBuffers(1, vbo) | |
gl.BindBuffer(GL.ARRAY_BUFFER, vbo[0]) | |
gl.BufferData(GL.ARRAY_BUFFER, ffi.sizeof(vertices), vertices, GL.STATIC_DRAW) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# you can have permission issues when it starts compiling libcurl, just chmod it | |
# libcurl test fails on a sizeof test | |
sudo apt-get install libssl-dev:i386 | |
# it doesn't find -lXext and -lXxf86vm | |
sudo ln -s /usr/lib/i386-linux-gnu/libXxf86vm.so.1 /usr/lib/i386-linux-gnu/libXxf86vm.so | |
sudo ln -s /usr/lib/i386-linux-gnu/libXext.so.6 /usr/lib/i386-linux-gnu/libXext.so | |
# then you need doomstarterkit/base in the same folder as doomx86 executable, and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
import json | |
import sys | |
def addr_to_url(addr): | |
return "http://nominatim.openstreetmap.org/?format=json&addressdetails=1&q=" + addr.strip().replace(" ", "+") + "&format=json&limit=1" | |
def addr_to_geo(addr): | |
url = addr_to_url(addr) | |
jsonreq = urllib2.urlopen(url).read() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h: \[\e[33m\]\w\[\e[0m\]\n\$ ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local lfs = require "lfs" | |
-- get all images in a path (there should be only images in this path) | |
wp_files = {} | |
wp_path = "/EDIT/THIS/PATH/" | |
for file in lfs.dir(wp_path) do | |
if file:sub(1,1) ~= '.' then | |
table.insert(wp_files,file) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"http://nvie.com/posts/how-i-boosted-my-vim/ | |
" load plugins | |
call pathogen#infect() | |
set guifont=Consolas\ 10 | |
set nocp | |
filetype on | |
filetype plugin on |
OlderNewer