Skip to content

Instantly share code, notes, and snippets.

View robertbasic's full-sized avatar

Robert Basic robertbasic

View GitHub Profile
@robertbasic
robertbasic / gist:709167
Created November 21, 2010 21:22
translit
str_replace(array('dž', 'lj', 'nj', 'DŽ', 'Dž', 'LJ', 'Lj', 'NJ', 'Nj', 'a', 'b', 'c', 'ć', 'č', 'd', 'đ', 'e', 'f', 'g', 'i', 'j', 'h', 'k', 'l', 'm', 'n', 'o', 'p', 'r', 's', 'š', 'u', 't', 'v', 'z', 'ž', 'А', 'B', 'C', 'Ć', 'Č', 'D', 'Đ', 'E', 'F', 'G', 'I', 'J', 'H', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'Š', 'U', 'T', 'V', 'Z', 'Ž'), array('џ', 'љ', 'њ', 'Џ', 'Џ', 'Љ', 'Љ', 'Њ', 'Њ', 'а', 'б', 'ц', 'ћ', 'ч', 'д', 'ђ', 'е', 'ф', 'г', 'и', 'ј', 'х', 'к', 'л', 'м', 'н', 'о', 'п', 'р', 'с', 'ш', 'у', 'т', 'в', 'з', 'ж', 'А', 'Б', 'Ц', 'Ћ', 'Ч', 'Д', 'Ђ', 'Е', 'Ф', 'Г', 'И', 'Ј', 'Х', 'К', 'Л', 'М', 'Н', 'О', 'П', 'Р', 'С', 'Ш', 'У', 'Т', 'В', 'З', 'Ж'), $text);
// next
$select->from(
array(
'photos' => $this->_name
),
array(
'photo_id', 'fk_user_id'
)
)
->where('photo_id > ?', $id)
action = QAction("My action", parent)
action.triggered.connect(my_slot(my_argument))
action = QAction("My action", parent)
action.triggered.connect(lambda arg=my_argument: my_slot(arg))
array('Extension', false, 'jpeg,jpg,png,gif,doc,docx,odt,ppt,pptx,odp,xls,xlsx,ods,pdf'),
array('MimeType', false, array('image/gif',
'image/jpeg',
'image/png',
'application/msword',
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/vnd.oasis.opendocument.text',
'application/vnd.ms-powerpoint',
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'application/vnd.oasis.opendocument.presentation',
<?php
require_once 'PHP/CompatInfo.php';
$source = '/home/robert/www/Zend/';
$driverType = 'xml';
$driverOptions = array();
$info = new PHP_CompatInfo($driverType, $driverOptions);
$ find /path/to -type d -exec chmod 775 {} \;
$ find /path/to -type f -exec chmod 664 {} \;
@robertbasic
robertbasic / gist:850574
Created March 2, 2011 06:55
setting up Zend_Dojo
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
public function _initViewHelpers()
{
$this->bootstrap('layout');
$this->_layout = $this->getResource('layout');
$this->_view = $this->_layout->getView();
@robertbasic
robertbasic / gist:850580
Created March 2, 2011 06:58
Basic Zend_Dojo_Form
<?php
class My_Form extends Zend_Dojo_Form
{
public function init()
{
$this->addElement(
'ValidationTextBox',
'title',
array(
'label' => 'Title:',
@robertbasic
robertbasic / gist:871410
Created March 15, 2011 20:31
multiple dijit.tooltip
var ttids = Array();
dijit.showTooltip=function(_a,_b,_c,_d){
if(!ttids[_b.id]){
ttids[_b.id]=new dijit._MasterTooltip();
}
return ttids[_b.id].show(_a,_b,_c,_d);
};
dijit.hideTooltip=function(_e){
if(!ttids[_e.id]){
ttids[_e.id]=new dijit._MasterTooltip();