Skip to content

Instantly share code, notes, and snippets.

View hoffoo's full-sized avatar

Marin hoffoo

  • UserVoice
  • Oakland, CA
View GitHub Profile
#!/bin/bash
# random words generator
dict="/usr/share/dict/american-english"
let word_c="$(wc -l $dict | awk '{print $1}')"
p=p
let oldseed=$(date +%N)
#!/bin/bash
# update pathogen .vim/bundle repositories
BACK=$(pwd)
update() {
cd $1
if [ -d ".git" ]; then
" vim beakpoint format to clipboard
func! CopyAsClip()
let s:pos=expand('%:p') . ':' . line('.')
call system("xclip", s:pos)
endfunc
#include <dlfcn.h>
#include <stdio.h>
int main()
{
if (!dlopen("libdbdpgsql.so", RTLD_NOW)) {
printf("couldnt open!\n");
} else {
printf("success!!!!!!\n");
}
@hoffoo
hoffoo / udpate_bundles.sh
Created April 28, 2014 20:21
update fugitive bundles
for r in *; do cd $r; git pull origin master; cd ..; done
@hoffoo
hoffoo / toggle_touchpad.sh
Created April 25, 2014 19:36
toggle touchpad xinput
#!/bin/sh
XINPUT_ENABLE_PROP=140
DEV=$(xinput list | grep TouchPad | cut -d= -f2 | cut -f1 | xargs)
XINPUT_TOGGLE_CMD="xinput set-prop $DEV $XINPUT_ENABLE_PROP"
XINPUT_STATUS=$(xinput list-props $DEV | grep $XINPUT_ENABLE_PROP | cut -d: -f2)
if [ $XINPUT_STATUS -eq "1" ]
then
XINPUT_TOGGLE=0
package pass
import (
"io"
"os"
"unicode"
)
type DB struct {
filename string
package togo
import (
"bufio"
"encoding/gob"
"io"
"time"
)
type Task struct {
@hoffoo
hoffoo / gist:7418135
Created November 11, 2013 18:42
get mailman emails per list
import os
import pickle
for d in os.walk("./"):
if len(d[2]) < 3:
continue
root = d[0]
conf = d[2][1]
f = open(root + "/" + conf)
@hoffoo
hoffoo / gist:7285657
Last active December 27, 2015 06:59
check for corrupt image files
package main
import (
"image"
_ "image/gif"
_ "image/jpeg"
_ "image/png"
"os"
"fmt"
)