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
#register this with ELB | |
# what is my name | |
myname=$(curl http://169.254.169.254/latest/meta-data/instance-id) | |
# what is my AvailabilityZone | |
myaz=$(curl http://169.254.169.254/latest/meta-data/placement/availability-zone) | |
#What is my region | |
myregion=${myaz%?} |
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
" copy all this into a vim buffer, save it, then... | |
" source the file by typing :so % | |
" Now the vim buffer acts like a specialized application for mastering vim | |
" There are two queues, Study and Known. Depending how confident you feel | |
" about the item you are currently learning, you can move it down several | |
" positions, all the way to the end of the Study queue, or to the Known | |
" queue. | |
" type ,, (that's comma comma) |
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
package main | |
import ( | |
"fmt" | |
"net/http" | |
) | |
func ServerModeBouncer(h http.Handler, mode *int64) http.Handler { | |
return http.HandlerFunc(func(w http.ResponseWriter, q *http.Request) { | |
switch q.Method { |
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/sh | |
#read more at http://alimoeenysbrain.blogspot.com/2013/10/automatic-versioning-with-git-commit.html | |
#replace all MYPROJECT with your project name | |
#for languages other than matlab replace all the .go extensions with your language extensions and modify BODY to reflect you language syntax | |
#for go (golang) see this gits: https://gist.github.com/alimoeeny/7005725 | |
VERBASE=$(git rev-parse --verify HEAD | cut -c 1-7) | |
echo $VERBASE | |
NUMVER=$(awk '{printf("%s", $0); next}' MYPROJECTversion.m | sed 's/.*MYPROJECT\.//' | sed 's/\..*//') |
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/sh | |
#read more at http://alimoeenysbrain.blogspot.com/2013/10/automatic-versioning-with-git-commit.html | |
#replace all MYPROJECT with your project name | |
#for languages other than go (golang) replace all the .go extensions with your language extensions and modify BODY to reflect you language syntax | |
VERBASE=$(git rev-parse --verify HEAD | cut -c 1-7) | |
echo $VERBASE | |
NUMVER=$(awk '{printf("%s", $0); next}' MYPROJECTversion.go | sed 's/.*MYPROJECT\.//' | sed 's/\..*//') | |
echo "old version: $NUMVER" |
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
[color] | |
ui = true | |
[alias] | |
lol = log --pretty=oneline --abbrev-commit --graph --decorate | |
la = log --pretty=\"format:%ad %h (%an): %s\" --date=short | |
dw = diff --word-diff | |
sb = status -sb | |
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C( bold blue)<%an>%Creset' --abbrev-comm it -- | |
lp = log -p | |
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
<html> | |
<body> | |
<script> | |
alert('ali here'); | |
function showResults(a) | |
{ | |
for(var key in a['data']) | |
{ | |
if (a['data'].hasOwnProperty(key)) { // this will check if key is owned by data object and not by any of it's ancestors | |
alert(key+': '+a['data'][key]); // this will show each key with it's value |
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 loadWithPrefix(matFileName, prefix) | |
load(matFileName) | |
allVariables = who; | |
for i = 1:length(allVariables) | |
if (strcmp(allVariables{i}, 'prefix') || strcmp(allVariables{i}, 'matFileName')) | |
% | |
else | |
disp([allVariables{i} ' -> ' prefix allVariables{i}]); | |
eval(['assignin(''base'', [prefix allVariables{i}] ,' allVariables{i} ');']); | |
end |
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/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
NewerOlder