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
| calc() { | |
| input="$*" | |
| sed -e 's/,/./g' <<< "scale=35; ${input//[[:blank:]]/}" | bc -l | sed 's/^\./0./;s/0*$//;s/\.$//' | |
| } |
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
| :lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; } | |
| :lang(he) { direction: rtl; } |
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
| git config --global alias.discover "!f(){ | |
| set -e; | |
| ((git branch --all | grep '^\s*remotes' | egrep --invert-match '(:?HEAD|master)$' | sed 's:remotes/origin/::' | xargs -n1 -I{} git branch --track {} remotes/origin/{} 2> /dev/null) || :) && | |
| git checkout master &> /dev/null; | |
| set +e; | |
| };f" | |
| git config --global alias.sync '!f(){ | |
| set -e; | |
| find . -maxdepth 10 -type d -name .git -prune | xargs -P$(getconf _NPROCESSORS_ONLN) -I{} dirname {} | xargs -P$(getconf _NPROCESSORS_ONLN) -I{} git -C {} fetch -p; |
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
| echo "g(i,x,t,o){return((3&x&(i*((3&i>>16?\"BY}6YB6%\":\"Qj}6jQ6%\")[t%8]+51)>>o))<<4);};x(i,n,s){for(i=0;;i++)putchar(g(i,1,n=i>>14,12)+g(i,s=i>>17,n^i>>13,10)+g(i,s/3,n+((i>>11)%3),10)+g(i,s/5,8+n-((i>>10)%3),9));}int main(int argc,char *argv[]){x(argc,argv[0],argv[1]);}"|gcc -xc -&&./a.out|play -t raw -b 8 -e unsigned -c 2 -r 44100 - |
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
| eval $(thefuck --alias) | |
| parse_git_branch() { | |
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
| #git rev-parse --abbrev-ref HEAD | |
| } | |
| export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ " | |
| alias ll="ls -al" |
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 | |
| finish() { | |
| command popd > /dev/null | |
| [ -d wrk2 ] && rm -rf wrk2 | |
| } | |
| trap finish EXIT | |
| echo "[info] building wrk2 from source" |
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
| function git-sync() { | |
| if [ -d .git ]; then | |
| branch=$(git rev-parse --abbrev-ref HEAD); | |
| if [ -n "$(git show-ref refs/remotes/origin/develop)" ] && [[ "$branch" != "develop" ]] && [[ "$branch" != "master" ]]; then | |
| git checkout develop | |
| git pull --all | |
| git pull --tags | |
| git checkout $branch | |
| git merge develop --no-ff | |
| else |
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
| package com.github.jancajthaml | |
| /** | |
| * Helpers without uneccessary roundtrips | |
| * | |
| * @author jan.cajthaml | |
| */ | |
| private[jancajthaml] object x { | |
| import java.security.SecureRandom |
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
| // Create a trust manager that does not validate certificate chains | |
| final TrustManager[] trustAllCerts = new TrustManager[]{new X509TrustManager() { | |
| @Override | |
| public java.security.cert.X509Certificate[] getAcceptedIssuers() { | |
| return null; | |
| } | |
| @Override | |
| public void checkClientTrusted(X509Certificate[] certs, String authType) { | |
| } |
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
| function shit() { | |
| case $1 in | |
| commit) git commit -am "$2";; | |
| status) git status .;; | |
| push) git push -u;; | |
| esac | |
| } |