Skip to content

Instantly share code, notes, and snippets.

moved to github --> https://github.com/bill-auger/git-branch-status/
@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
@nicolasembleton
nicolasembleton / restart_bluetooth.sh
Last active May 11, 2024 17:43
Restart Bluetooth Daemon on Mac OS X without restarting
#!/bin/bash
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
@josephspurrier
josephspurrier / values_pointers.go
Last active May 15, 2025 14:43
Golang - Asterisk and Ampersand Cheatsheet
/*
********************************************************************************
Golang - Asterisk and Ampersand Cheatsheet
********************************************************************************
Also available at: https://play.golang.org/p/lNpnS9j1ma
Allowed:
--------
p := Person{"Steve", 28} stores the value
@domenic
domenic / opensearch.xml
Last active February 19, 2023 02:33
opensearch.xml for HTML Standard
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>HTML Standard</ShortName>
<Description>Search the WHATWG HTML Living Standard.</Description>
<Image width="16" height="16" type="image/x-icon">data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAC2klEQVR4Xm3TbUxWZRjA8f95eY4PvrTGB0UGYxUuKjVYoRauBa0aai5rxbKcLxvSEBZogG5uQc4NncUe1HDU+uBMCiLUKKmRUGLzDQJdKQjqHLpswOppPC/nHJ6rcz6c7Ynx+3B/uq/r3nVf16Ws3DWbadJEpGAqZq+1Y9YjCKqmamOa5utUFfU4cIE4Ov+3IWpH9iMkJT2YStr8DHy6wb2J2/NHx4cfD5uhrQlGQj0o1UAYQMUDlc6Fo+lJS5L2rD9Ga9UQBws7+GjTSZp2DPBp8Vlyl6zzh6LhypjEWoF58QnecYL35WTk01D0E88vXseJC42Uf76GLYeeZW/LVkLRILUbmtmcV4Uds/NFYkcAXQVSTSsaWLRwKe7Lhs/Pu0dyqWkuxbItnkjNpneky0mUR5uTtGR1LW88U0zYjKwH3iJnV0JF9vuanO49Jq6OviZ5rASpb68Qz+Bon7h3Cg8/J67xf+/Lqj0psqLSdwrn+O6VvWkSnJwQ193xW9Jz7XsJhibE0/NHuywtQ0obXxbPh19tkazt3ObpHVzb1viizMQLfqk6WZZXzpYzV1rFc/znOsks5x9VwGfos5jJ+aEfnY98
@traeH-Heart
traeH-Heart / Project Directory Structure
Created March 2, 2015 06:19
Recommended Project Directory Structure
<project name>/
application/
configs/
application.ini
controllers/
helpers/
forms/
layouts/
filters/
helpers/
@v0lkan
v0lkan / nginx.conf
Last active April 15, 2025 11:53
Configuring NGINX for Maximum Throughput Under High Concurrency
user web;
# One worker process per CPU core.
worker_processes 8;
# Also set
# /etc/security/limits.conf
# web soft nofile 65535
# web hard nofile 65535
# /etc/default/nginx
@DarrenN
DarrenN / get-npm-package-version
Last active May 2, 2025 08:59 — forked from yvele/get-npm-package-version.sh
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
echo $PACKAGE_VERSION
@rponte
rponte / get-latest-tag-on-git.sh
Last active December 9, 2024 00:27
Getting latest tag on git repository
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples
@Ladicek
Ladicek / maven-deploy-sources.sh
Created January 7, 2016 09:51
deploy *-sources.jar to internal Maven repository
#!/bin/bash
# successful "mvn clean install" or a variant thereof (e.g. -DskipTests)
# is typically required before running this script
REPOSITORY_ID=...
REPOSITORY_URL=...
mvn clean source:jar