This file contains hidden or 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 hidden or 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
/* | |
* a smart poller for jquery. | |
* (by github) | |
* | |
* simple example: | |
* | |
* $.smartPoller(function(retry) { | |
* $.getJSON(url, function(data) { | |
* if (data) { | |
* doSomething(data) |
This file contains hidden or 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) { |
This file contains hidden or 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 -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 |
This file contains hidden or 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 | |
# Script to convert PDF file to JPG images | |
# | |
# Dependencies: | |
# * pdftk | |
# * imagemagick | |
PDF=$1 |
This file contains hidden or 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
#!/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): |
This file contains hidden or 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
#!/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 |
This file contains hidden or 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 | |
// Yerleştirme planımız. | |
function plan() { | |
return array( | |
'mühendislik' => array( | |
'salonlar' => array( | |
'a101' => array( | |
'kapasite' => 1, | |
), |
This file contains hidden or 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 | |
# | |
# 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) |