Skip to content

Instantly share code, notes, and snippets.

View pamolloy's full-sized avatar

Philip Molloy pamolloy

View GitHub Profile
@pamolloy
pamolloy / post-update
Created April 1, 2014 14:53
`git submodule` commands cause `remote: fatal: Not a git repository: '.'`
#!/bin/bash
TMPDIR=$(mktemp --directory --quiet)
git clone $HOME/http $TMPDIR
cd $TMPDIR
git submodule init
git submodule update
jekyll &>/home/git/jekyll.log
rm -rf $TMPDIR
exit
@pamolloy
pamolloy / latex.sh
Last active January 1, 2016 16:39
Install vim LaTeX software
aptitude install texlive-full texlive-math-extra gnuplot
pdflatex example.tex
aptitude install vim-latexsuite
vim-addons install latex-suite
@pamolloy
pamolloy / qemu.sh
Created December 29, 2013 16:23
Install, setup and run a QEMU image
aptitude update
aptitude full-upgrade
aptitude install qemu
qemu-img create -f qcow2 image.qcow2 5G
qemu -hda image.qcow2 -cdrom debian-7.2.0-i386-netinst.iso -boot d -m 256
qemu -hda image.qcow2 -m 256
@pamolloy
pamolloy / example.vbs
Last active December 31, 2015 03:49
Using VBScript function procedures open a text file and also modify one cell in an Excel worksheet
' Introduction to Scripting Microsoft Office - http://technet.microsoft.com/en-us/library/ee176994.aspx
strExcelFilename = "C:\Users\Philip\Desktop\report_template.xls"
strPLNFilename = "C:\Users\Philip\Desktop\sample.pln"
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const row = 13, col = 1, text = "Test"
Function OpenFileRead(FileName)
Set objFileSystemObject = CreateObject("Scripting.FileSystemObject")
If objFileSystemObject.FileExists(FileName) Then ' Check if the file exists
Set objFile = objFileSystemObject.OpenTextFile(FileName, ForReading)
@pamolloy
pamolloy / dropdown.py
Created October 21, 2013 22:49
An example of overloading open() in kivy/uix/dropdown.py to allow the function to be bound to a TextInput object
from kivy.app import App
from kivy.uix.button import Button
from kivy.uix.dropdown import DropDown
from kivy.uix.textinput import TextInput
class TextDropDown(DropDown):
def __init__(self, *args, **kwargs):
super(TextDropDown, self).__init__(*args, **kwargs)
def open(self, widget, text):
@pamolloy
pamolloy / config
Last active December 26, 2015 04:09
Additions to my i3 window manager configuration file saved to ~/.i3/config
# Window decoration colors
client.focused #7f8f9e #617180 #cfdfee
client.focused_inactive #444b54 #343b44 #848b94
client.unfocused #3a4047 #2a3037 #7a8087
client.urgent #b73f3d #b33b39 #fffff0
# Custom keyboard bindings
# Scripts available in https://github.com/pamolloy/bin
bindsym XF86Tools exec xterm -e ncmpcpp
bindsym XF86AudioNext exec mpc next
@pamolloy
pamolloy / TestPlan.py
Last active December 20, 2015 20:49
Executing the original code generated a window with only one widget (see http://i.imgur.com/JALe6q4.png). The problem was that I called the parent class within the super function.
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.button import Button
from kivy.uix.textinput import TextInput
class TestPlan(GridLayout):
def __init__(self, **kwargs):
super(TestPlan, self).__init__(**kwargs)
self.cols=2
@pamolloy
pamolloy / remote-copy.bash
Last active December 17, 2015 21:29
Copy files to a remote host
echo -e "Host $host\nPort $port" >> ~/.ssh/config
rsync --archive --recursive --compress --times --update -e ssh $path $host:$path
@pamolloy
pamolloy / vimrc
Last active December 14, 2015 20:19
An in-progress vim configuration file
" SHOW INVISIBLES
" vimcasts.org/episodes/show-invisibles/
" Disable syntax highlighting for Markdown files
autocmd BufRead,BufNewFile *.md syntax off
" Shortcut to toggle `set list` with `\l`
" Note the "mapleader" variable is set to backslash by default
nmap <leader>l :set list!<CR>
@pamolloy
pamolloy / affixe.txt
Created November 19, 2012 16:09
Affixe vom Grammatische Woerterbuch auf ids-mannheim.de
a- (ahistorisch) (Affix)
a- (Apräsenz) (Affix)
-abel (akzeptabel) (Affix)
-ade (Marinade) (Affix)
-ade (Robinsonade) (Affix)
-age (Sabotage) (Affix)
-age (Spionage) (Affix)
-aille (Diplomaille) (Affix)
-al (instrumental) (Affix)
-al (optimal) (Affix)