Skip to content

Instantly share code, notes, and snippets.

template<class Iterator>
void quickSort(Iterator begin, Iterator end)
{
Iterator pivot = begin;
if (begin == end) {
return;
}
@ercanozkaya
ercanozkaya / hack.sh
Created April 1, 2012 16:18 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2276734/hack.sh | sh
#
@ercanozkaya
ercanozkaya / cli.php
Created October 24, 2011 14:54
Command Line Dispatcher
<?php
/**
* @category Nooku
* @package Nooku_Server
* @subpackage Default
* @copyright Copyright (C) 2011 Timble CVBA and Contributors. (http://www.timble.net).
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
* @link http://www.nooku.org
*/
@ercanozkaya
ercanozkaya / batch_symlinker
Created October 13, 2011 16:53
A script to symlink various repositories into one installation at once
#!/usr/bin/env python
import sys, os
help = """
Usage: ./batch_symlinker destination projects [..]
Example: ./batch_symlinker joomla17 nooku-framework nooku-components fileman
"""
projects_dir = '/Users/ercan/Projects'
sites_dir = '/Users/ercan/www'
#!/usr/bin/python
import sys, os
source_dir = os.path.realpath(sys.argv[1])
target_dir = os.path.realpath(sys.argv[2])
"""
This function merges the source directory to target directory as symlinks
@Author: Israel D. Canasa (http://israelcanasa.com)
@ercanozkaya
ercanozkaya / packager.py
Created October 5, 2010 22:00
A packager for Joomla extensions
import sys, os, shutil, glob, zipfile
from xml.etree.ElementTree import ElementTree
class Packager:
temp = 'temp'
def __init__(self):
pass
def package(self, manifest_path):
self.manifest_path = manifest_path
{
"jsonapi": {
"version": "1.0"
},
"links": {
"self": "http:\/\/docman.dev\/administrator\/index.php?option=com_docman&view=documents&format=json"
},
"data": [
{
"type": "document",
$document_details = array(
'title' => 'document title',
'docman_category_id' => 1,
'storage_type' => 'file',
'storage_path' => 'path/to/the/file' // part of the path that comes after joomlatools-files/docman-files/
);
$result = KObjectManager::getInstance()->getObject('com://site/docman.controller.document', array(
'request' => KObjectManager::getInstance()->getObject('request')
))->add($document_details);
<?php
/**
* Put this file in the cli/ folder in your Joomla site and call it from the command line:
* $ php filename.php
*/
@ini_set('memory_limit', -1);
@ini_set('xdebug.max_nesting_level', 2000);
const _JEXEC = 1;
const FOF_INCLUDED = 1; // Trick the system into believing FOF is already included
@ercanozkaya
ercanozkaya / files.form.js
Last active August 29, 2015 14:14
Date field in batch screen
kQuery(function($) {
var requests = [],
flattenArray = function(items){
var object = {};
$.each(items, function(i, item){
object[item.name] = item.value;
});
return object;
},
getQueryString = function(form, defaults) {