- 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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func main() { | |
start := time.Now() | |
elapsed := time.Since(start) | |
log.Printf("Binomial took %s", elapsed) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git branch | grep -v "master" | xargs git branch -D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ( | |
BYTE = 1.0 << (10 * iota) | |
KILOBYTE | |
MEGABYTE | |
GIGABYTE | |
TERABYTE | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lsof -nP -i4TCP:$PORT | grep LISTEN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew tap grpc/grpc | |
brew install --with-plugins grpc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// formatRequest generates ascii representation of a request | |
func formatRequest(r *http.Request) string { | |
// Create return string | |
var request []string | |
// Add the request string | |
url := fmt.Sprintf("%v %v %v", r.Method, r.URL, r.Proto) | |
request = append(request, url) | |
// Add the host | |
request = append(request, fmt.Sprintf("Host: %v", r.Host)) | |
// Loop through headers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Delete all containers | |
docker rm $(docker ps -a -q) | |
# Delete all images | |
docker rmi $(docker images -q) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
$('#some-element').on('keypress keydown', isNumber); | |
}) | |
function isNumber(evt) { | |
evt = (evt) ? evt : window.event; | |
var charCode = (evt.which) ? evt.which : evt.keyCode; | |
if (charCode > 31 && (charCode < 48 || charCode > 57) && charCode != 37 && charCode != 39 && charCode != 46) { | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
newExcitingAlerts = (function () { | |
var oldTitle = document.title; | |
var msg = "New!"; | |
var timeoutId; | |
var blink = function() { document.title = document.title == msg ? ' ' : msg; }; | |
var clear = function() { | |
clearInterval(timeoutId); | |
document.title = oldTitle; | |
window.onmousemove = null; | |
timeoutId = null; |
NewerOlder