Dotfiles are now all together at home
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] | |
stat = status -sb | |
graph = log --oneline --decorate --graph --topo-order | |
desc = log -1 --decorate | |
leaderboard = shortlog -sne | |
sync = !git pull --rebase && git push | |
[push] | |
default = simple |
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
#include <wordexp.h> | |
#include <stdio.h> | |
void expand_word(const char * word) { | |
wordexp_t words = {0}; | |
puts(word); | |
wordexp(word, &words, WRDE_NOCMD); | |
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
;; Defines a simple generic mode to hilight lasm files | |
(define-generic-mode 'lasm-mode | |
;; Comment start marker, we just do single line comments for now | |
'("//") | |
;; Keywords, these are just taken verbose from opslist.h | |
'("pushloc" "pusharg" "pushlitn" "pushlitd" "pushlits" "pushtrue" "pushfalse" | |
"pushnull" "pushident" "poploc" "poparg" "dup" "pop" "idlook" "ntod" "ntos" | |
"dtos" "btos" "xton" "xtod" "xtob" "xtos" "add" "sub" "mul" "div" "mod" | |
"pow" "log" "neg" "inc" "dec" "cat" "slice" "strchar" "strcmp" "lt" "lteq" | |
"gt" "gteq" "eq" "noteq" "not" "and" "or" "print" "jump" "jumpt" "jumpf" |
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/env ruby | |
require 'pathname' | |
def find_config_file(file_name, path) | |
path = Pathname(path) unless path.is_a? Pathname | |
path = path.realpath | |
path.ascend do |subpath| | |
location = subpath + file_name |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <openssl/ripemd.h> | |
int main(int argc, const char* argv[]) { | |
FILE* file; | |
int length; | |
unsigned char* buffer; |
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
class Namespace(object): | |
"""Namespace | |
Represents a read-only access to a dictionary through the . operator. Used | |
to allow easy access to options and suchlike. Should be both Python 2.7 and | |
3.x compatible. | |
""" | |
def __init__(self, dict): | |
self.__dict__.update(dict) |
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/env bash | |
# Touch any files that don't exist | |
for file in "$@" | |
do | |
echo "$file" | |
if [ ! -a "$file" ]; then | |
touch "${file}" | |
fi | |
if [ ! -w "$file" ] || [ ! -r "$file" ]; then |
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/ruby | |
require 'wiringpi' | |
require 'net/ping' | |
require 'syslog' | |
# Constants | |
OUTPUT_PINA = 0 # RPi Pin 11 | |
OUTPUT_PINB = 1 # RPi Pin 12 | |
ARM_ON_TIME = 0.1 |