This file contains 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
#! /usr/bin/python | |
# | |
# Author: Gaute Hope <eg@gaute.vetsj.com> / 2016-08-12 | |
# | |
# Find all substrings in a string with the number of occurences of a set of | |
# characters pre-defined. | |
# | |
# A prime number is assigned to each character in the key set, all other | |
# characters are assigned 1. The product of the key set will match the product | |
# of the substring. Search the string with a running product to find substring |
This file contains 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
" Bookmarks and FavEx: combining startify and FavEx | |
let g:startify_bookmarks = [] | |
" \ '~/.vim/vimrc', | |
" \ ] | |
for line in readfile (expand('~/.vim/bundle/FavEx/favlist')) | |
if line !~ '\"' && line != "" | |
call add (g:startify_bookmarks, line) | |
endif | |
endfor |
This file contains 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
# /bin/bash | |
# | |
# Makes a sparsebundle and set it up | |
hostname=$(hostname) | |
# create sparsebundle | |
hdiutil create -size 300g -library SPUD -fs HFS+J -type SPARSEBUNDLE -volname "Backup-${hostname}" "${hostname}.sparsebundle" | |
# enable unsupported volumes |
This file contains 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
[alias] | |
pullify = config --add remote.origin.fetch '+refs/pull/*/head:refs/remotes/origin/pr/*' |
This file contains 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
#! /bin/bash | |
# A module for lbdb (http://www.spinnaker.de/lbdb/) for gmail | |
# using goobook. | |
# Copyright (C) 2013 Gaute Hope <eg@gaute.vetsj.com> | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or |
This file contains 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
#! /bin/bash | |
# A module for lbdb (http://www.spinnaker.de/lbdb/) for the sup address | |
# book (http://sup.rubyforge.org) | |
# Copyright (C) 2009 Gaute Hope <eg@gaute.vetsj.com> | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or |
This file contains 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
/* Based on: http://stackoverflow.com/questions/8571089/how-can-i-find-endian-ness-of-my-pc-programmatically-using-c | |
* | |
* Build: gcc -o whatendianness whatendianness.c | |
* | |
*/ | |
# include <stdio.h> | |
int main (int argc, char **argv) { | |
int num = 1; |
This file contains 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
#! /bin/bash | |
# Wrapper for curl, posting to the sprunge.us pastebin | |
cat $1 | curl -F 'sprunge=<-' http://sprunge.us | |
This file contains 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
#! python | |
# Format: (y, x, [userdata], ..) | |
# Sorterer i stigande rekkefølge | |
positions = [ (1.0 , 1.1, 1), | |
(10.0 , 50.0, 2), | |
(9.0 , 39.0, 3), | |
(30.0 , 5.0, 4), | |
(40.0 , 10.0, 5), | |
] |