Skip to content

Instantly share code, notes, and snippets.

View robindegen's full-sized avatar

Robin 'Ruadeil' Degen robindegen

View GitHub Profile
#pragma comment(lib, "Xinput.lib")
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <Xinput.h>
/*
Source for ida_patcher
Copyright (c) 2006 Chris Eagle cseagle at gmail.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 (at your option)
any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
@robindegen
robindegen / gist:5a69b24cea581a2909b4
Created September 28, 2014 18:24
Change name/email of all git commits (requires force push)
git filter-branch -f --env-filter \
"GIT_AUTHOR_NAME='Robin Degen'; GIT_AUTHOR_EMAIL='[email protected]'; \
GIT_COMMITTER_NAME='Robin Degen'; GIT_COMMITTER_EMAIL='[email protected]';" HEAD
@robindegen
robindegen / gist:8325561a1b20266d2c8e
Last active January 11, 2023 15:30
Force delete all dangling git commits
git reflog expire --expire=90.days.ago --expire-unreachable=now --all
git gc --prune=now
@robindegen
robindegen / gist:b53ffe24cfb69c044ce6
Created November 8, 2014 16:30
Enable windows credential storage for msysgit
git config --global credential.helper wincred
@robindegen
robindegen / gist:a59c34eeffbabc0dc68a
Created December 2, 2014 14:33
Export git repo to zip or tarbal
git archive master --format=zip --output=../snapshot.zip
git archive master --format=tar --output=../snapshot.tar

Building and installing Git from source on OS X Lion

This outline for building and installing Git has only been tested against Mac OS X 10.7.x (Lion). While these steps may work for previous versions of Mac OS X, I cannot confirm this. Furthermore, you're on your own, if you screw something up, it's not my fault.

If you have Xcode 4, you have Git!

Xcode 4 includes the Git binary at the application level so it's available to itself (located at /Applications/Xcode.app/Contents/Developer/usr/bin/git). Additionally, Xcode 4 includes a new "Downloads" preference pane to install optional components, one of which are the Command Line Tools (similar to the Dev Tools package that shipped with older versions of Xcode) and once installed, Git (and many other utilities, such as make) is installed at the system level (located at /usr/bin).

*Note: You don't have to install Xcode to use the Command Line Tools; it can be downloaded independently from the Apple Developer site (you need to login, but it's free

@robindegen
robindegen / gist:2981f32f3cc5db674eae
Created January 14, 2015 20:58
Fix Deathadder mouse speed on Fedora
xinput --set-prop "Razer Razer DeathAdder" "Device Accel Constant Deceleration" 2
@robindegen
robindegen / gist:c96fcd3ab393c887889f
Created January 30, 2015 06:39
Reading raw data from a physical drive in windows
#define _CRT_SECURE_NO_WARNINGS
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
HANDLE handle = CreateFile(
"\\\\.\\PhysicalDrive0",
GENERIC_READ,
@robindegen
robindegen / gist:e07929e5aa9b0f5c7f83
Created May 29, 2015 13:59
Fix git push over nginx proxy
git config --global http.postBuffer 157286400