Skip to content

Instantly share code, notes, and snippets.

@cduruk
cduruk / gunce_scraper.rb
Created November 11, 2008 19:16
Small screen scraper to see if there have been updates in Turkish Guncem.com journal-keeping service.
# Tum haklari serbesttir.
require 'rubygems'
require 'mechanize'
require 'hpricot'
if ARGV.length < 2
puts "Kullanici adi ve sifre girmen lazim."
exit
end
Duruk:~ cduruk$ curl -I 37signals.com
HTTP/1.1 200 OK
Date: Fri, 06 Mar 2009 19:23:56 GMT
Server: Apache/2.2.4
Accept-Ranges: bytes
X-Powered-By: PHP/5.2.4
Content-Type: text/html
@cduruk
cduruk / .bash_profile
Created April 7, 2009 01:59
My .bash_profile for SL
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function proml {
local BLUE="\[\033[0;34m\]"
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"
local GREEN="\[\033[0;32m\]"
local LIGHT_GREEN="\[\033[1;32m\]"
~/Desktop $ cat log.txt
11:40:11 PM Can Duruk: 2700 even if 1 per cent clicks on that
11:40:20 PM Marshall Roch: lol
11:51:13 PM Can Duruk: wtf, i just got a robocall from at&t saying that my payment method no more works
11:51:33 PM Can Duruk: it's an autopay with my card which expires next year
11:51:40 PM Can Duruk: and i have money on it
11:51:56 PM Marshall Roch: lol
11:52:44 PM Can Duruk: there's a stupid problem with stainless, when you open a new tab, the focus is not on the address bar
11:53:37 PM Can Duruk: even though he knew better, George
11:54:25 PM Marshall Roch: lol
YUI().use('node', 'plugin',
function(Y) {
var PieMenu = function(config) {
this.init(config);
};
//Plugin Settings
PieMenu.NAME = 'piemenu';
PieMenu.NS = 'pm';
# You actually need to be logged in for this to work. Even then, no guarantees
require 'rubygems'
require 'open-uri'
require 'nokogiri'
require 'net/http'
#target = 'http://www.linkedin.com/in/'+ARGV[0]
result = Nokogiri::HTML(open(ARGV[0]))
10:24:34 PM Can Duruk: let's see
10:24:44 PM Can Duruk: http://qkpic.com/d9468
@cduruk
cduruk / deploy.sh
Created July 23, 2009 04:50
Jekyll Deployment Script
#! /bin/sh
echo "Commit message:"
read
git add .
git commit -avm "$REPLY"
git push origin master
jekyll
rsync -ave ssh _site/ pistone.dreamhost.com:blog.duruk.net
~/Documents/dev/eclipse/Buzz $ sloccount .
Have a non-directory at the top, so creating directory top_dir
Adding /Users/cduruk/Documents/dev/eclipse/Buzz/./buzz_20090701.bat to top_dir
Creating filelist for doc
Adding /Users/cduruk/Documents/dev/eclipse/Buzz/./gridstart.bat to top_dir
Adding /Users/cduruk/Documents/dev/eclipse/Buzz/./pom.xml to top_dir
Creating filelist for target
Creating filelist for test-output
Adding /Users/cduruk/Documents/dev/eclipse/Buzz/./velocity.log to top_dir
Creating filelist for src_test
@cduruk
cduruk / crime_report.md
Created August 29, 2009 22:21
Email that I sent to CMU PD

Hi,

I am a CMU student and I would like to report a crime incident that has happened around 12:45AM on Saturday 29, 2009.

On my way to my apartment on Amberson Avenue, I was robbed at gunpoint; actors stealing my wallet, forcefully demanding my PIN and getting my phone. After the incident, I called 911 and Pittsburgh PD showed up.

Fortunately, I was able to track my phone online using its GPS function; I was able to see the location of the phone on a map. With my friends, we tracked the phone to North Versailles and relayed that information to Pittsburgh PD and North Versailles PD.

Ultimately, we tracked the phone to an Eat 'n Park restaurant in North Versailles. With that information, NVPD caught the actors there. Afterwards I identified the actors in a line-up. I have received my phone, my wallet and most of the cash in my wallet.