Skip to content

Instantly share code, notes, and snippets.

Onur Değerli onurdegerli

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am onurdegerli on github.
  • I am onrdgr (https://keybase.io/onrdgr) on keybase.
  • I have a public key ASCSbqF6BapS4KF-5zlvsyHWZhTcxXrgyx_mhmj_lrfu6Qo

To claim this, I am signing this object:

View git-search.sh
#!/bin/bash
for c in $(git log -S "function_name" --format=%H -- folder/file.php); do
git --no-pager grep -F -e "function_name" $c -- folder/file.php
done
@onurdegerli
onurdegerli / show-file-commit-history.sh
Last active Aug 29, 2015
Show files commit history from git in a loop.
View show-file-commit-history.sh
#!/bin/bash
for i in $(eval echo {$2..$3})
do
git show HEAD~${i} ${1}
done
View cool-python-commands.py
# get the python sys.path list
>>> import sys
>>> for path in sys.path: print path
...
# add python sys.path
>>> sys.path.append('/explicit/path/to/myproject')
@onurdegerli
onurdegerli / rsync-one-file.sh
Created Jan 13, 2014
Linux rsync specific file with rsync command. Usage: ./rsync-one-file.sh /directory/file.php
View rsync-one-file.sh
#!/bin/bash
if [ -n "$1" ]
then
file=$1
rsync -crlPavpz --delete --exclude-from 'exclude.txt' /source-directory/$file user@192.168.1.1:/destination-directory/$file
else
exit 1
fi
View sh-commands.sh
# located in /usr/bin
# gpom
git push origin master
# rsync-project
#!/bin/bash
cd /home/$user/rsync-files
./rsync-prject-sh
View after-ubuntu-install.sh
# upgrade ubuntu
sudo apt-get update
sudo apt-get dist-upgrade
sudo update-manager -d
# git
sudo apt-get install git
# oh-my-zsh
sudo apt-get update && sudo apt-get install zsh
View get_stackexchange_tags.py
#!/usr/bin/python
import MySQLdb
import urllib2
from urllib2 import Request, urlopen, URLError, HTTPError
import re
import sys
baseUrl = 'http://meta.stackoverflow.com/tags?page={pageNumber}&tab=popular'
regexForTag = re.compile("<a href=\"(.*)\" class=\"(.*)\" title=\"(.*)\" rel=\"tag\">(.*)</a><span class=\"item-multiplier\"><span class=\"item-multiplier-x\">&times;</span>&nbsp;<span class=\"item-multiplier-count\">(.*)</span></span>")
View get_job_titles.py
#!/usr/bin/python
import MySQLdb
import urllib2
from urllib2 import Request, urlopen, URLError, HTTPError
import re
regex = re.compile("<li>([\w &;/<>]*?)</li>")
db = MySQLdb.connect(host="",
View get_function_names_in_a_directory.py
#!/usr/bin/python
import sys
import glob
import os
import re
# define base directory
baseDirectory = ""
You can’t perform that action at this time.