Skip to content

Instantly share code, notes, and snippets.

View alifahrri's full-sized avatar
🌊

Fahri Ali Rahman alifahrri

🌊
View GitHub Profile
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@dalemyers
dalemyers / pdfcoloursplitter.py
Last active April 1, 2024 15:58
PDF Colour Splitter
#!/usr/bin/env python
# Python 2 and 3 compatible.
#This script takes in a PDF and creates two new PDFs. One has the black and
#white pages and the other has the colour pages. It also takes duplex printing
#into account. So a black and white side which is on the same sheet as a colour
#side will be placed into the colour PDF.
#This is from a script created by Iain Murray. The original comment is below.
#This version simply has some different defaults and removes the PDFtoPPM.
@yamamushi
yamamushi / bresenham3d
Created June 20, 2013 15:03
C++ Bresenham 3d Line Drawing Algorithm
// Bresenham3D
//
// A slightly modified version of the source found at
// http://www.ict.griffith.edu.au/anthony/info/graphics/bresenham.procs
// Provided by Anthony Thyssen, though he does not take credit for the original implementation
//
// It is highly likely that the original Author was Bob Pendelton, as referenced here
//
// ftp://ftp.isc.org/pub/usenet/comp.sources.unix/volume26/line3d
//
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream