Skip to content

Instantly share code, notes, and snippets.

View hmert's full-sized avatar
🎃
fintech

Hüseyin Mert hmert

🎃
fintech
View GitHub Profile
// gizli ajax manager kodlarım :D
var ajax = $.ajax,
pendingRequests = {},
synced = [],
syncedData = [],
ajaxRunning = [];
// huseyin.im
jQuery(function($){
// Tarihi 2009-06-10 -> Ocak 04, 2009
$('.zaman').each(function(){
var tarih = this.getAttribute('datetime');
tarih = tarih.split('-');
if (tarih.length != 3){
return true;
}
// ikilemeleri yok ediyorum böylece
function replaceDups(field) {
field = field.replace(/\s(\w+\s)\1/, " $1");
return field;
}
// apache_request_headers replicement for nginx
if (!function_exists('apache_request_headers')) {
function apache_request_headers() {
foreach($_SERVER as $key=>$value) {
if (substr($key,0,5)=="HTTP_") {
$key=str_replace(" ","-",ucwords(strtolower(str_replace("_"," ",substr($key,5)))));
$out[$key]=$value;
}else{
$out[$key]=$value;
}
<?php
// en basit php proxy
$url = $_GET['url'];
header('Content-type: text/plain');
echo file_get_contents($url);
// 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;
};
#! /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
/**
* rating password by Google
*
* @author hatem <huseyin@hmert.com>
* @param password the password to rate by google.
* @return rate
* @return string
*/
function ratePass($password) {
// 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));
}
/*
jQuery Form resetleyici
*/
$.fn.clearForm = function () {
return this.each(function () {
$('input,select,textarea', this).clearFields();
});
};
$.fn.clearFields = $.fn.clearInputs = function () {
return this.each(function () {