Skip to content

Instantly share code, notes, and snippets.

@jonfk
jonfk / ubuntusetupvm6414.04.1.sh
Last active August 29, 2015 14:08
ubuntu setup vm 64-bit 14.04.1
echo 'Grab a cup of tea. This is going to take a while...'
sudo apt-get update -qq
sudo apt-get upgrade -y
sudo apt-get update -qq
sudo apt-get install -yq emacs24 git vim curl wget openjdk-7-jdk tmux awesome awesome-extra xchat
git clone https://github.com/jonfk/dotfiles.git
cd dotfiles;./dotfiles -u;
cd

change to postgres user and open psql prompt

sudo -u postgres psql postgres

or

psql -U postgres

list databases

@jonfk
jonfk / Makefile
Created July 22, 2015 03:49
python c ffi
all:
gcc -shared -Wl,-soname,testlib -o testlib.so -fPIC testlib.c
clean:
rm testlib.so
@jonfk
jonfk / .vimrc
Last active December 14, 2015 06:39
.vimrc
"forget being compatible with good ol' vi
set nocompatible
" Remove the annoying bell
set visualbell
set encoding=utf-8
" Get that filetype stuff happening
filetype on
@jonfk
jonfk / .emacs
Last active December 15, 2015 14:59
My emacs config. Emacs 24+
(setq inhibit-startup-screen t)
(setq inhibit-splash-screen t)
;;(setq-default truncate-lines t)
(setq visible-bell t)
(require 'cl)
(setq scroll-step 1
scroll-conservatively 10000)
;; Custom message in the scratch buffer
@jonfk
jonfk / git_cheatsheet.adoc
Last active September 19, 2016 18:08
git_cheatsheet

Git Cheatsheet

Table of Contents

Git Branches

  • view all branches including remote

@jonfk
jonfk / keybase.md
Created March 12, 2018 21:10
keybase.md

Keybase proof

I hereby claim:

  • I am jonfk on github.
  • I am jonfk (https://keybase.io/jonfk) on keybase.
  • I have a public key ASA_ts-tV6nov6vpEaScVpWVIoZo-5PE4F2EdZxKoeip5wo

To claim this, I am signing this object:

@jonfk
jonfk / websocket_server.rs
Created September 26, 2016 04:28
Trying to link rust-websocket and tokio-core
extern crate websocket;
extern crate tokio_core;
extern crate futures;
use websocket::{Server, Message, Sender, Receiver};
use websocket::message::Type;
use websocket::header::WebSocketProtocol;
use futures::Future;
use futures::stream::Stream;
fn pig_latin_word(word: &str) -> String {
let mut chars_iter = word.chars();
let mut first_last = if let Some(first) = chars_iter.next() {
let mut rest: String = chars_iter.collect();
rest.push(first);
rest
} else {
"".to_owned()
};
#!/bin/bash
# Fix X window manager name properties to work around java bugs with
# non-reparenting window managers. This is a different solution from
# the wmname utility provided by suckless, as it is NetWM compatible,
# while wmname sets the value of _NET_SUPPORTING_WM_CHECK to root win.
IRONIC_WM_NAME="LG3D"
NET_WIN=$(xprop -root _NET_SUPPORTING_WM_CHECK | awk -F "# " '{print $2}')