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 | |
IPADDR=127.0.0.1 | |
STARTPORT=8000 | |
ENDPORT=9000 | |
found=false | |
for (( port = $STARTPORT ; port <= $ENDPORT ; port++ )); do | |
printf "Checking $port\r"; | |
if ! nc -z -w5 $IPADDR $port | |
then |
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
/** | |
* Simple singleton pattern in TypeScript | |
*/ | |
module Utils { | |
class GreeterSingleton { | |
public sayHello(name:string) : void { | |
alert(`Hello ${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
console.clear(); | |
var $ = function(selector) { | |
var list = document.querySelectorAll(selector) | |
var each = function(callback) { | |
return function() { | |
for(var a = 0; a != list.length; a++) { | |
var obj = list[a]; | |
callback.apply(obj,arguments); | |
} | |
return list; |
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 | |
RED='\033[0;31m' | |
NC='\033[0m' | |
cur_branch_name=$(git symbolic-ref -q HEAD) | |
cur_branch_name=${cur_branch_name##refs/heads/} | |
cur_branch_name=${cur_branch_name:-HEAD} | |
cache=~/bin | |
reponame=$(basename $(git rev-parse --show-toplevel)) |
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
// Extract Material Design Colors from the specs website. | |
// open [https://www.google.com/design/spec/style/color.html#color-color-palette] in FireBug | |
// Then run | |
console.clear(); | |
var mdPalette = { | |
}; | |
var sassPalette = [ | |
]; | |
var colorPalette = document.querySelector('.color-palette'); | |
var colorGroups = colorPalette.querySelectorAll('.color-group'); |
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
jQuery(document).ready(function($){ | |
var headerHeight = $('#masthead').outerHeight(); | |
$('#go-top, .next-page').localScroll({ | |
offset: { | |
top: -headerHeight | |
} | |
}); | |
$(window).scroll(function(){ | |
if($(window).scrollTop() > 200){ |
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
#!/usr/bin/php | |
<?php | |
if(count($argv) !== 2) { | |
die("Need a new branch name\n"); | |
} | |
$info = pathinfo($argv[0]); | |
$command = str_replace("git-","",$info["basename"]); | |
$new_branch = str_replace(array(' ',"\\","\"","\t","\n","\r","-"),'-',$argv[1]); |
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 | |
# This bash script will try to create a new relase and publish an | |
# npm package at the same time | |
function confirm() | |
{ | |
echo -n "$@ " | |
read -e answer | |
for response in y Y yes YES Yes Sure sure SURE OK ok Ok |
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 | |
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | |
DOTNET_ROOT=${SCRIPT_DIR}/.dotnet | |
BIN_DIR=${SCRIPT_DIR}/bin | |
DOTNET_INSTALL=${BIN_DIR}/dotnet-install.sh | |
DOTNET=${DOTNET_ROOT}/dotnet | |
CAKE=${BIN_DIR}/dotnet-cake | |
export DOTNET_CLI_TELEMETRY_OPTOUT=1 |
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 | |
curent_branch=$(git rev-parse --abbrev-ref HEAD) | |
exists=$(git show-ref refs/heads/$1) | |
back_branch=$1 | |
if [ -z "${exists}" ]; then | |
echo -e "\033[91mERROR: \033[0mInvalid or missing back branch ${back_branch}" | |
exit 1; | |
fi | |
echo -e "\033[96mINFO: \033[0m Merging \033[93m${curent_branch} \033[0monto \033[93m${back_branch}\033[0m" |