Skip to content

Instantly share code, notes, and snippets.

@typpo
typpo / neural-style-ec2.txt
Created June 4, 2016 19:38 — forked from elad/neural-style-ec2.txt
Running neural-style in EC2
Start a g2.2xlarge or better (GPU instance) with https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#LaunchInstanceWizard:ami=ami-ffba7b94
Login, username is ubuntu
Update a bunch of stuff and make sure cudnn R2 is used:
luarocks install image
luarocks install loadcaffe
luarocks install torch
export LD_LIBRARY_PATH=/home/ubuntu/torch-distro/install/lib:/home/ubuntu/torch-distro/install/lib:/home/ubuntu/cudnn-6.5-linux-x64-v2-rc2
@typpo
typpo / personalcapital_export_view.js
Created April 12, 2016 03:05
Export PersonalCapital view (with all filters) to CSV
(function() {
var data = angular.element(document.querySelector('.dataGrid')).scope().data;
var headers = ['Date', 'Account', 'Description', 'Category', 'Reimbursable', 'Amount'];
var csv = headers.join(',') + '\n';
data.forEach(function(data) {
var reimbursable = data._search_term.indexOf('reimbursable') > -1 ? 'REIMBURSABLE' : '';
fields = [data.transactionDate, data.accountName, data.description, data.category.name, reimbursable, data.value];
csv += fields.map(function(val) {
return '"' + val + '"';
}).join(',') + '\n';
set nocompatible
filetype off
set backspace=indent,eol,start
" Exit visual mode without delay.
set timeoutlen=1000 ttimeoutlen=0
set cul " cursor line
set cpo+=J
@typpo
typpo / winxp.desktop
Created October 10, 2015 22:51
Play the winxp sound when you login to xfce (in .config/autostart)
[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=Windows XP sound effect
Comment=
Exec=bash /home/ian/winxp.sh
OnlyShowIn=XFCE;
StartupNotify=false
Terminal=false
@typpo
typpo / vimrc
Created September 19, 2015 01:06
set nocompatible
filetype off
set backspace=indent,eol,start
set cul " cursor line
set cpo+=J
" causes python problems:
" set smartindent
" inoremap # X^H#
@typpo
typpo / rapchat iframe
Last active August 29, 2015 14:07
rapchat iframe
<div style="position: fixed; bottom: 0; right: 0; height: 400px; width: 300px; z-index: 9999;"><iframe height="400" width="300" src="http://ianww.com/rapchat?r=arthena&iframe=1"></iframe></div>
@typpo
typpo / focus follows mouse
Last active August 29, 2015 14:01
focus follows mouse
gsettings set org.gnome.desktop.wm.preferences focus-mode 'mouse'
gconftool-2 --type boolean --set /apps/metacity/general/auto_raise false
@typpo
typpo / caps lock escape swap
Created May 13, 2014 20:44
caps lock escape swap
! Swap caps lock and escape
remove Lock = Caps_Lock
keysym Escape = Caps_Lock
keysym Caps_Lock = Escape
add Lock = Caps_Lock
@typpo
typpo / obfuscated.c
Last active August 29, 2015 14:00
obfuscated
#define _ 0xBEE7
#define print(str)'='//;printf\("You guessed: %s\n", str\);
#include <stdio.h>
#define f(X) int
union fi {f(fi) x; char y;}i;int main() {f(10) ff=10;for (i.x=0; (long)i.x < 1+
4*19*643-_+ff;){if(!i.x++ & _< ff)z:if (putchar(ff) && _)return ff;}print([x
for x in set(ff)]);printf("%d", (f(.))i.x);f(1) x;sscanf("22","%d", &x);
sprintf(&i.y, "%c", print(ff));printf("%c%c", putchar(print(4__2)),i.y);
print(__);f(fi{for(;;)}) y;putchar('Z'-x);goto z;}
@typpo
typpo / vimrc
Last active August 29, 2015 14:00
set nocompatible
set backspace=indent,eol,start
set cul " cursor line
set cpo+=J
" causes python problems:
" set smartindent
" inoremap # X^H#
set cindent