Skip to content

Instantly share code, notes, and snippets.

View davidpfarrell's full-sized avatar

David Farrell davidpfarrell

View GitHub Profile
@mnemnion
mnemnion / git-move.sh
Created August 15, 2022 11:35
Move files from one git repo to another, following renames
#! /bin/bash
# Usage:
# ./git-move.sh path1/ path2/... path/to/destination/repo
args=("$@")
# All but last argument:
paths=("${args[@]::${#args[@]}-1}")
# Last argument:
dest="${args[${#args[@]}-1]}"
@IamFaizanKhalid
IamFaizanKhalid / git-commit-author.md
Last active June 30, 2024 09:47
Change author information of previous commits.

Interactive rebase off of a point earlier in the history than the commit you need to modify (git rebase -i <earliercommit>). In the list of commits being rebased, change the text from pick to edit next to the hash of the one you want to modify. Then when git prompts you to change the commit, use this:

git commit --amend --reset-author --no-edit

For example, if your commit history is A-B-C-D-E-F with F as HEAD, and you want to change the author of C and D, then you would...

  1. Update author's info git config --global user.email example@email.com
  2. Specify git rebase -i B (here is an example of what you will see after executing the git rebase -i B command)
@mzfr
mzfr / findtraitor.py
Created June 11, 2019 13:39
Find users who unstarred your repository
"""Help you find users who unstared your repository
"""
import os
import sys
import requests_cache
import argparse
URL = "https://api.github.com/repos/{}/{}/stargazers?per_page=100&page={}"
@dploeger
dploeger / bitshifter.patch
Created March 13, 2017 08:27
nibtools bitshifter.c patch for macOS
Index: bitshifter.c
===================================================================
--- bitshifter.c (revision 637)
+++ bitshifter.c (working copy)
@@ -439,13 +439,25 @@
// > 0 <= C <= 7 (see above)
// > *b = Next bit position to be copied from 'db' (1 <= B <= 8)
// > [ ((Q << C) & 0xff00) + new bits from db ] >> C
- **q = ( ( (__int32)((**q) >> (8-*c)) << 8) | (((__int32)db << (*b-1)) & 0xff) ) >> *c;
+ **q = ( ( (int32_t)((**q) >> (8-*c)) << 8) | (((int32_t)db << (*b-1)) & 0xff) ) >> *c;
@moksamedia
moksamedia / gist:5475917
Created April 28, 2013 04:45
Gradle: to automatically discover subprojects and include them in your root project, put this in your settings.gradle file
/*
* Here we iterate over the directories found in the root directory of the
* main project, and if the subdirectory contains a build.gradle file, it
* is added to the main project as a subproject.
*/
Closure discoverSubprojects = {
def list = []
rootDir.eachDir(){ dir ->
dir.eachFileMatch({it == 'build.gradle'}, { list += [dir.name] })