This file contains hidden or 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 | |
id=$(uuidgen | cut -c -8) | |
markdown $1 > /tmp/md-$id | |
open -a "/Applications/Google Chrome.app" file:///tmp/md-$id | |
This file contains hidden or 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 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" |
This file contains hidden or 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
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";}' |
This file contains hidden or 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
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' |
This file contains hidden or 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
''' | |
---- | |
dciw2.py | |
---- | |
Copyright @itmard | |
------ | |
usage | |
create directory for all picture | |
replace dir with full path to picture directory |
This file contains hidden or 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
''' | |
Created on Sep 15, 2013 | |
@author: Mohammad reza Kamalifard | |
usage : | |
python dciw.py imagename | |
''' |
This file contains hidden or 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
def add(x, y): | |
return x + y | |
def sub(x, y): | |
return x - y | |
def mul(x, y): | |
This file contains hidden or 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
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): |
This file contains hidden or 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
from pyparsing import Word, alphas | |
greet = Word( alphas ) + "," + Word( alphas ) + "!" # <-- grammar defined here | |
hello = "Hello, World!" | |
print (hello, "->", greet.parseString( hello )) |
This file contains hidden or 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
<!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)); |