Skip to content

Instantly share code, notes, and snippets.

View rezkam's full-sized avatar
🏠
Working from home

Rez rezkam

🏠
Working from home
View GitHub Profile
@rezkam
rezkam / dciw2.py
Last active August 29, 2015 14:03
dciw2.py
'''
----
dciw2.py
----
Copyright @itmard
------
usage
create directory for all picture
replace dir with full path to picture directory
@rezkam
rezkam / git alias
Created August 4, 2014 21:06
itmard git alias (iga)
alias gis='git status'
alias gil='git log'
alias gull='git pull origin '
alias gica='git commit -a -m '
alias gush='git push origin '
alias granch='git branch '
alias gich='git checkout '
alias gif='git diff'
@rezkam
rezkam / musc.bash
Created December 16, 2014 14:30
Most Used Shell Commands
history | awk '{h[$2]++}END{for(i in h){print h[i],i|"sort -rn|head -20"}}' |awk '!max{max=$1;}{r="";i=s=60*$1/max;while(i-->0)r=r"#";printf "%15s %5d %s %s",$2,$1,r,"\n";}'
@rezkam
rezkam / ping_notify.sh
Created January 1, 2015 07:07
Ping test and notify for OS X
#!/usr/bin/env bash
# you need to install terminal-notifier with $ brew install terminal-notifier
while [ "true" ]
do
count=$(ping -c 4 4.2.2.4 | grep 'received' | awk -F',' '{ print $2 }' | awk '{ print $1 }')
if [ $count -eq 4 ]; then
echo "Test pass!"
else
echo "Test Faild"
@rezkam
rezkam / mdreader
Created January 17, 2015 14:27
Markdown generator from terminal for osx
#!/bin/bash
id=$(uuidgen | cut -c -8)
markdown $1 > /tmp/md-$id
open -a "/Applications/Google Chrome.app" file:///tmp/md-$id
// Our person constructor
function Person (name, age) {
this.name = name;
this.age = age;
}
// We can make a function which takes persons as arguments
// This one computes the difference in ages between two people
var ageDifference = function(person1, person2) {
return person1.age - person2.age;
<!doctype html>
<html lang="en">
<head>
<title>Test Suite with CSS</title>
<script>
function assert(value, desc) {
var li = document.createElement("li");
li.className = value ? "pass" : "fail";
li.appendChild(document.createTextNode(desc));
from pyparsing import Word, alphas
greet = Word( alphas ) + "," + Word( alphas ) + "!" # <-- grammar defined here
hello = "Hello, World!"
print (hello, "->", greet.parseString( hello ))
@rezkam
rezkam / org.tehlug.Calc.py
Created October 16, 2013 00:04
Simple Calculator for Python Work group
def add(x, y):
return x + y
def sub(x, y):
return x - y
def mul(x, y):
return x * y
def div(x, y):
@rezkam
rezkam / Tehlug-calc.py
Created October 17, 2013 23:52
Simple Calculator for Tehlug
def add(x, y):
return x + y
def sub(x, y):
return x - y
def mul(x, y):