Skip to content

Instantly share code, notes, and snippets.

View hmert's full-sized avatar
🎃
fintech

Hüseyin Mert hmert

🎃
fintech
View GitHub Profile
@hmert
hmert / gist:732236
Created December 7, 2010 19:10 — forked from remy/gist:333954
// 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);
@hmert
hmert / gist:733909
Created December 8, 2010 21:03 — forked from defunkt/gist:158493
/*
* a smart poller for jquery.
* (by github)
*
* simple example:
*
* $.smartPoller(function(retry) {
* $.getJSON(url, function(data) {
* if (data) {
* doSomething(data)
@hmert
hmert / gist:733921
Created December 8, 2010 21:13 — forked from defunkt/gist:3124
(function($) {
////
//
// Depends on the amazing Ajax form plugin.
//
// Callback receives responseText and 'success' / 'error'
// based on response.
//
// i.e.:
// $('#someform').spamjax(function(text, status) {
#!/bin/bash -xe
echo "deb http://archive.canonical.com/ lucid partner">>/etc/apt/sources.list
apt-get update
sudo apt-get -y install sun-java6-jdk
update-java-alternatives -s java-6-sun
sudo apt-get install scala mysql-server mysql-client libmysql-java git-core
sudo groupadd etherpad
@hmert
hmert / pdf2jpg.sh
Created December 8, 2010 21:32 — forked from yura/pdf2jpg.sh
#!/bin/bash
# Script to convert PDF file to JPG images
#
# Dependencies:
# * pdftk
# * imagemagick
PDF=$1
@hmert
hmert / t.py
Created December 8, 2010 21:48 — forked from roktas/t.py
#!/usr/bin/python
#-*-coding:utf-8-*-
# Code stolen and modified from Emre Sevinç:
# http://github.com/emres/turkish-deasciifier
def set_char_at(string, pos, c):
return string[0:pos] + c + string[pos+1:]
def turkish_accent(c):
#!/usr/bin/python
# -*- coding: utf-8 -*-
import MySQLdb, MySQLdb.cursors
# bağlantı oluştur
db = MySQLdb.connect(
host="localhost",
user="as_fbel_a",
passwd="*", # bunlar gizli
<?php
// Yerleştirme planımız.
function plan() {
return array(
'mühendislik' => array(
'salonlar' => array(
'a101' => array(
'kapasite' => 1,
),
@hmert
hmert / mkv2m4v.sh
Created December 8, 2010 22:08 — forked from dzuelke/mkv2m4v.sh
#!/bin/bash
#
# mkv2m4v inputfile.mkv
#
# Given an MKV container with H.264 video and AC3 audio, converts
# quickly to an iPad-compatible MP4 container without re-encoding the
# video (so it must already be in an iPad-compatible resolution); the
# audio is downmixed to stereo with Dynamic Range Compression.
#
ME=$(basename $0)