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;
}
{
"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) {

Keybase proof

I hereby claim:

  • I am ercanozkaya on github.
  • I am ercanozkaya (https://keybase.io/ercanozkaya) on keybase.
  • I have a public key whose fingerprint is B0A6 E9BD A356 B535 A489 8557 99CA 0840 179C 46A7

To claim this, I am signing this object:

@ercanozkaya
ercanozkaya / purge.sh
Last active August 29, 2015 13:57 — forked from vmassuchetto/purge.sh
#!/bin/sh
# Credits to:
# - http://vstone.eu/reducing-vagrant-box-size/
# - https://github.com/mitchellh/vagrant/issues/343
# - https://gist.github.com/adrienbrault/3775253
# Unmount project
umount /vagrant
@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'