Skip to content

Instantly share code, notes, and snippets.

View robertbasic's full-sized avatar

Robert Basic robertbasic

View GitHub Profile
@robertbasic
robertbasic / gist:1647965
Created January 20, 2012 15:49
PHP 5.4 rc6 test summary
=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped : 51
Exts tested : 26
---------------------------------------------------------------------
Number of tests : 12002 8160
Tests skipped : 3842 ( 32.0%) --------
Tests warned : 0 ( 0.0%) ( 0.0%)
@robertbasic
robertbasic / uploader.sh
Created February 5, 2012 23:47
Poor man's GtkGrab :P
#!/bin/bash
# based on GtkGrab by @EvanDotPro https://github.com/EvanDotPro/GtkGrab
function rename_file()
{
NEWFILE=$(echo $1 | md5sum | cut -c-5)'.png'
}
REMOTE=user@domain.tld:/home/user/screens/
@robertbasic
robertbasic / gist:1753335
Created February 6, 2012 17:03
Dojo Editor
define([
'dojo/query',
'dojo/dom-construct',
'dojo/dom-attr',
'dijit/Editor',
"dijit/_editor/plugins/LinkDialog",
"dijit/_editor/plugins/ViewSource"
],
function(query, construct, attr, Editor) {
@robertbasic
robertbasic / gist:1758387
Created February 7, 2012 08:54
dojo -_-
require([
'dojo/ready', 'dojo/query'
],
function (ready, query) {
function callThat() {
console.log(query("#id")); // works
}
ready(function() {
callThat();
callThis();
@robertbasic
robertbasic / gist:1853506
Created February 17, 2012 13:42
Imagick segfault
robert@odin ~/www$ gdb php
GNU gdb (GDB) Fedora (7.3.50.20110722-10.fc16)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
$ php -v
PHP 5.3.10 (cli) (built: Feb 2 2012 22:12:16)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
with Xdebug v2.2.0-dev, Copyright (c) 2002-2012, by Derick Rethans
$ php -i | grep -A 2 xdebug | grep Version
Version => 2.2.0-dev
$ php -r 'var_dump("Testing");'
string(7) "Testing"
@robertbasic
robertbasic / gist:1904467
Created February 24, 2012 23:15
PHP #53823
(gdb) break php_pcre.c:1318
Breakpoint 1 at 0x49e066: file /home/robert/php/php5trunk/ext/pcre/php_pcre.c, line 1318.
(gdb) run run-tests.php ext/pcre/tests/bug53823.phpt
<<snip>>
Breakpoint 1, preg_replace_impl (ht=3, return_value=0x7ffff1971518, return_value_ptr=0x0, this_ptr=0x0, return_value_used=1, is_callable_replace=0,
is_filter=0) at /home/robert/php/php5trunk/ext/pcre/php_pcre.c:1318
1318 if (!is_callable_replace && Z_TYPE_PP(replace) == IS_ARRAY && Z_TYPE_PP(regex) != IS_ARRAY) {
(gdb) print **subject
@robertbasic
robertbasic / imgur-uploader
Created March 8, 2012 21:46
xfce4-screenshooter to imgur
#!/bin/bash
function rename_file()
{
NEWFILE=$(echo $1 | md5sum | cut -c-5)'.png'
}
API_KEY=PUT_YOUR_IMGUR_API_KEY_HERE
URL=http://api.imgur.com/2/upload
<?php
$adapter = $this->getAdapter();
$langQuoted = $adapter->quote($lang);
$sql = "
(SELECT * FROM `news` WHERE published = 1 AND lang = " . $langQuoted . ")
UNION ALL
(SELECT * FROM `events` WHERE published = 1 AND lang = " . $langQuoted . ")
ORDER BY `date` DESC
";
@robertbasic
robertbasic / import.qif
Created May 8, 2012 08:21
Example import QIF to GnuCash
!Type:Cat
NExpenses
^
!Type:Bank
D05/08/2012
T50.00
Pexp four
LAssets:Current Assets:Checking Account
^
!Type:Bank