Skip to content

Instantly share code, notes, and snippets.

View richjava's full-sized avatar

Richard Lovell richjava

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
@rocco
rocco / cordova-keystore
Last active March 7, 2018 08:44
cordova/phonegap: create keystore (to sign apk)
# create keystore
keytool -genkey -v -keystore [somename].keystore -alias [somename] -keyalg RSA -keysize 2048 -validity 10000
# follow instructions
# to keep things simple, use [somename] for .keystore file name and alias too
# same for password: just press enter on this prompt:
# ---------------------------------------------------
# Enter key password for <[somename]>
# (RETURN if same as keystore password):
@victorquinn
victorquinn / promise_while_loop.js
Last active March 30, 2023 04:29
Promise "loop" using the Bluebird library
var Promise = require('bluebird');
var promiseWhile = function(condition, action) {
var resolver = Promise.defer();
var loop = function() {
if (!condition()) return resolver.resolve();
return Promise.cast(action())
.then(loop)
.catch(resolver.reject);