Skip to content

Instantly share code, notes, and snippets.

Murat Çorlu muratcorlu

Block or report user

Report or block muratcorlu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@muratcorlu
muratcorlu / tabmenu.css
Created Sep 29, 2010
A simple tabmenu implementation with jQuery
View tabmenu.css
div.tabcontent {
display:none;
}
div.active {
display:block;
}
View jsonencode.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="tr" lang="tr">
<head>
<title> JSON Encoder </title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<?php
if($_POST) {
$unicodes = array('\u015f', '\u015e', '\u011f', '\u011e', '\u0130', '\u0131', '\u00fc', '\u00dc', '\u00d6', '\u00f6', '\u00c7', '\u00e7');
@muratcorlu
muratcorlu / simpletimer.js
Created Oct 10, 2010
Simple timer with javascript
View simpletimer.js
var timer = {
started: 0,
end: 0,
now: function(){ return new Date(); },
start: function(){ return this.started = this.now(); },
since: function(){ this.end = this.now(); return this.now()-this.started; }
}
// Usage:
@muratcorlu
muratcorlu / flashEvent.js
Created Oct 19, 2010
Fire events that can listen by Javascript from Flash
View flashEvent.js
/*
* Flash runs fireFlashEvent function with a event name parameter and
* several optional parameters. Javascript can listen these events by
* binding with addFlashEventListener function.
*
* Requires jQuery
*/
// Global Document object for caching $(document) selector
Document = null;
@muratcorlu
muratcorlu / json.py
Created Jan 26, 2012
Python command line script to JSON parse
View json.py
#!/usr/bin python
"""
requires simplejson module (https://github.com/simplejson/simplejson)
Usage example:
tail -f /var/log/json.log | grep "muratcorlu.com" | python json.py log.date log.url
"2011.12.14 14:21" "http://muratcorlu.com/post/archieve/"
"2011.12.14 14:29" "http://muratcorlu.com/"
@muratcorlu
muratcorlu / tckimlik.py
Created Mar 11, 2012
Python ile TC Kimlik numara doğrulama
View tckimlik.py
# coding=utf-8
"""
Kurallar:
* 11 hanelidir.
* Her hanesi rakamsal değer içerir.
* İlk hane 0 olamaz.
* 1. 3. 5. 7. ve 9. hanelerin toplamının 7 katından, 2. 4. 6. ve 8. hanelerin toplamı çıkartıldığında, elde edilen sonucun 10'a bölümünden kalan, yani Mod10'u bize 10. haneyi verir.
* 1. 2. 3. 4. 5. 6. 7. 8. 9. ve 10. hanelerin toplamından elde edilen sonucun 10'a bölümünden kalan, yani Mod10'u bize 11. haneyi verir.
Kurallar http://www.kodaman.org/yazi/t-c-kimlik-no-algoritmasi adresinden alınmıştır.
@muratcorlu
muratcorlu / jquery_disqus_lazyload.js
Created Apr 3, 2012
Load disqus comments when visitor scroll down page to comments
View jquery_disqus_lazyload.js
/**
* Load disqus comments when visitor scroll down page to comments
*
* Usage:
* Add a div with id "disqus_thread" and data attributes for every disqus parameter:
*
* <div id="disqus_thread" data-disqus-shortname="username" data-disqus-url="http://example.com/post/post-name/"></div>
*
* @author: Murat Corlu
* @link: https://gist.github.com/gists/2290198
View filter.py
SearchQuerySet().filter(user__iexact="murat").filter(content__startswith=request.GET.get('q'))[:10]
@muratcorlu
muratcorlu / default.js
Created Jul 11, 2012
lazyHandler examples
View default.js
$('#header li a.clickable').click(function);
@muratcorlu
muratcorlu / slugify_tr.js
Created Sep 11, 2012
Javascript Türkçe karakter destekli slugify (url metni oluşturucu)
View slugify_tr.js
/**
* Metni url'de kullanılabilir hale çevirir. Boşluklar tireye çevrilir,
* alfanumerik olmayan katakterler silinir.
*
* Transform text into a URL path slug(with Turkish support).
* Spaces turned into dashes, remove non alnum
*
* @param string text
*/
slugify = function(text) {
You can’t perform that action at this time.