This file contains 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
// ikilemeleri yok ediyorum böylece | |
function replaceDups(field) { | |
field = field.replace(/\s(\w+\s)\1/, " $1"); | |
return field; | |
} |
This file contains 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
<?php | |
// en basit php proxy | |
$url = $_GET['url']; | |
header('Content-type: text/plain'); | |
echo file_get_contents($url); |
This file contains 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
// rastgele rakamlı harfli değer üretir. | |
var randomString = function(numchars) { | |
var chars = "0123456789ABCDEFGHJKMNPQRSTUVWXYZabcdefghkmnpqrstuvwxyz"; | |
var randomstring = ''; | |
for (var i=0; i<numchars; i++) { | |
var rnum = Math.floor(Math.random() * chars.length); | |
randomstring += chars.substring(rnum,rnum+1); | |
} | |
return randomstring; | |
}; |
This file contains 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 | |
# ubuntu'da vorbis-tools ve mplayer yuklu olmalidir | |
echo "Bu bash kod ile tum mp3leriniz converted klasorune ogg olarak donusturulur" | |
mkdir converted | |
for i in *.mp3; do | |
mv "$i" `echo $i | tr ' ' '_'` | |
echo $i |
This file contains 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
/** | |
* rating password by Google | |
* | |
* @author hatem <huseyin@hmert.com> | |
* @param password the password to rate by google. | |
* @return rate | |
* @return string | |
*/ | |
function ratePass($password) { |
This file contains 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
// url encoding | |
utfTools.prototype.encode = function (string) { | |
return escape(this._utf8_encode(string)); | |
} | |
// url decoding | |
utfTools.prototype.decode = function (string) { | |
return this._utf8_decode(unescape(string)); | |
} | |
This file contains 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
/* | |
jQuery Form resetleyici | |
*/ | |
$.fn.clearForm = function () { | |
return this.each(function () { | |
$('input,select,textarea', this).clearFields(); | |
}); | |
}; | |
$.fn.clearFields = $.fn.clearInputs = function () { | |
return this.each(function () { |
This file contains 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
// pure JS | |
function shuffle(array) { | |
return array.sort(function(){ | |
return .5 - Math.random(); | |
}); | |
} | |
// with Prototype.js you can do | |
function shuffle(array){ | |
return array.sortBy(Math.random); |
This file contains 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($) { | |
//// | |
// | |
// Depends on the amazing Ajax form plugin. | |
// | |
// Callback receives responseText and 'success' / 'error' | |
// based on response. | |
// | |
// i.e.: | |
// $('#someform').spamjax(function(text, status) { |