Skip to content

Instantly share code, notes, and snippets.

View androm3da's full-sized avatar

Brian Cain androm3da

View GitHub Profile
@seanh
seanh / mergelog.py
Created April 25, 2010 18:50
A custom merge driver for git, for automatically merging my 'log.txt' file in a simplistic way.
#!/bin/env python
"""mergelog
This is a custom merge driver for git. It should be called from git
with a stanza in .git.config like this:
[merge "mergelog"]
name = A custom merge driver for my log.txt file.
driver = ~/scripts/mergelog %O %A %B %L
recursive = binary
@jefftrull
jefftrull / main.cpp
Created October 22, 2011 02:00
Example of embedding Ruby interpreter into C/C++ program
// very basic embedded Ruby interpreter for C++ programs
// thrown together by Jeff Trull <jetrull@sbcglobal.net> based on googling and asking questions on #ruby-lang
#include <ruby.h>
// access to C variables
static VALUE getter(VALUE ns, VALUE var) {
return Qfalse;
}
VALUE setter(VALUE ns, VALUE var, VALUE val) {
@mathiasverraes
mathiasverraes / .bashrc
Created November 3, 2011 18:46 — forked from thomasvm/.bashrc
Git shortcuts
#! /bin/sh
alias gs="git status"
alias gc="git commit"
alias gr="git checkout"
alias ga="git add"
alias gl="git lola"
@eculver
eculver / .gitconfig
Created November 9, 2011 19:41
Sample .gitconfig
[user]
name = Joe User
email = joe@joeuser.com
[branch]
autosetupmerge = true
[branch "master"]
remote = origin
merge = refs/heads/master
@thenigan
thenigan / gist:1854688
Created February 17, 2012 18:13
git-mergetool--lib.sh mod to use defaults if no custom merge tool config file is found
#!/bin/sh
# git-mergetool--lib is a library for common merge tool functions
diff_mode() {
test "$TOOL_MODE" = diff
}
merge_mode() {
test "$TOOL_MODE" = merge
}
@olivierlacan
olivierlacan / git_log.md
Created August 2, 2012 15:06
My git log custom output aliases
git config --global alias.hist "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short"
git config --global alias.lol "log --graph --decorate --pretty=oneline --abbrev-commit --all"
git config --global alias.mylog "log --pretty=format:'%h %s [%an]' --graph"

To check that they've been added correctly, first run git config --list. You should see something like this in the midst of all your other configuration:

alias.hist=log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short
@tangrs
tangrs / bin2elf.sh
Last active April 15, 2024 02:34
Convert a memory dump/raw binary image into an ELF file
#!/bin/sh
# Convert a raw binary image into an ELF file suitable for loading into a disassembler
cat > raw$$.ld <<EOF
SECTIONS
{
EOF
echo " . = $3;" >> raw$$.ld
@stepchowfun
stepchowfun / merger.py
Last active September 3, 2023 03:04
My three-way merge algorithm, originally designed for 6.033 DP2.
#!/usr/bin/python -O
################################################################################
################################################################################
#
# State-Based Text Merging Algorithm
# For 6.033 Design Project 2
# TA: Katherine Fang
# 9 May 2012
#
@nicholashagen
nicholashagen / gist:5306330
Created April 3, 2013 23:12
HDHomeRun Configuration Command Line

Download Source

#> wget http://download.silicondust.com/hdhomerun/libhdhomerun_20130117.tgz
#> tar zxvf libhdhomerun_20130117.tgz 

Install Tools

@rossant
rossant / raytracing.py
Last active December 24, 2023 12:50
Very simple ray tracing engine in (almost) pure Python. Depends on NumPy and Matplotlib. Diffuse and specular lighting, simple shadows, reflections, no refraction. Purely sequential algorithm, slow execution.
"""
MIT License
Copyright (c) 2017 Cyrille Rossant
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is