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
# Clone a fresh copy of origin repo and enter into it | |
git clone <giturl-repoA> | |
cd <repoA> | |
# Optional, to avoid pushing to the wrong remote repository | |
git remote rm origin | |
# From the repo source, remove all the files and history ourside the folder | |
git filter-branch --subdirectory-filter <folder-name> -- --all | |
# Optional, move all the files previously in the folder to a new one, as they are in the repo root now, and commit them (no push) | |
mkdir <directory-new-name> | |
mv * <directory-new-name> |
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
# Create function that will run when a certain phrase is typed in terminal | |
# and tab key is pressed twice | |
_grunt_complete() | |
{ | |
# fill local variable with a list of completions | |
local COMPLETES=`grep -s 'grunt\.registerTask' Gruntfile.js | sed "s/\s*grunt.registerTask('\([^']*\)',.*$/\1/g"` | |
# we put the completions into $COMPREPLY using compgen | |
COMPREPLY=( $(compgen -W "$COMPLETES" -- ${COMP_WORDS[COMP_CWORD]}) ) | |
return 0 |
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
var http = require('http'); | |
var request = require('request'); | |
function forceHttpError(error) { | |
var originalHttpRequest = http.request; | |
// Monkey-patch the http.request method with | |
// our implementation | |
http.request = function (opts, cb) { | |
// Call the original implementation of http.request() | |
var req = originalHttpRequest(opts, cb); |
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
# SETUP CONSTANTS | |
# Bunch-o-predefined colors. Makes reading code easier than escape sequences. | |
# Reset | |
Color_Off="\[\033[0m\]" # Text Reset | |
# Regular Colors | |
Black="\[\033[0;30m\]" # Black | |
Red="\[\033[0;31m\]" # Red | |
Green="\[\033[0;32m\]" # Green |