Skip to content

Instantly share code, notes, and snippets.

View Freeaqingme's full-sized avatar
💭
Hello? Is this thing on?

Dolf Schimmel Freeaqingme

💭
Hello? Is this thing on?
View GitHub Profile
dolf@dolf-ThinkPad-T520:~/Projects/Pacman/library/ZendFramework/tests$ ./runtests.sh Zend/Loader/LoaderTest.php
++ phpunit --verbose --group Zend/Loader/LoaderTest.php
PHP Fatal error: Cannot redeclare class ZendTest\Cloud\Infrastructure\Adapter\Skip in /home/dolf/Projects/Pacman/library/ZendFramework/tests/Zend/Cloud/Infrastructure/Adapter/RackspaceOnlineTest.php on line 261
<root>
<div>
<p>
<p>A</p>
<p>B</p>
<p>C</p>
</p>
</div>
<div>
<p>
@Freeaqingme
Freeaqingme / gist:1731637
Created February 3, 2012 18:35
BSD'ed AcceptHandler Plugin by Freeaqingme, Enrise
<?php
/**
* Determne the media type and format to serve based on the accept headers
*
* How this class works:
* It first determines which mediatypes that are part of the accept header can be
* possibly used based on their formats. In a later stage one can pick
* a specific mediatype using the method match(). This method is meant to select
* the most specific entry that still matches the requested media type.
// Does not work
define(["dojo/query"], function($){
$("td").on("click", function(event) {
console.log(event);
});
});
// Works
dojo.query("td").forEach(function(node) {
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.11 (GNU/Linux)
mQENBE/R6SkBCADPn7z8yFESArSkJVD7flHP0//915WmNclYRyPUGu5MI665Gs9E
KcJ/pn7rirsq2CrArIZNdTLFOoAcT8R68qqiSQAt2U3MYb7np7fwC/wuAuHMOqi6
Q/1wgcpTfQ8KPGuocNN3NnH66QsiCwUanFsjkHVOQTgtfodmP64e9RRx4bwFJOqA
H+9j9ha9XJNbwVnT89OgRwUbIpWA8Mlg7DV2Jf6KOtvn+xTungmO7WZLFIEaWXbz
6kte8hw4cynctTBGllokPF/Eq0H37C0qf+rTTII93eZCvArLeWmMCjlI/jymGDpf
+obbCOJfy2XeobPmNLo8Zrm4x4Ulxb4RM1OrABEBAAG0H0RvbGYgU2NoaW1tZWwg
PGRvbGZAZW5yaXNlLmNvbT6JATgEEwECACIFAk/R6SkCGwMGCwkIBwMCBhUIAgkK
Input:
application/vnd.foobar+html;q=1; version="2\3\""; level="foo, bar", text/json;level=1, text/xml;level=2;q=0.4
Goal: Explode string by the comma's it contains
Contraints:
* commas between quotes (") dont count
* quotes may be escaped
Expected output:
* application/vnd.foobar+html;q=1; version="2\3\""; level="foo, bar"
SELECT GROUP_CONCAT(SUBSTRING('1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_$@' , 1+ FLOOR(RAND()*LENGTH('1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_$@')) ,1) SEPARATOR '')
FROM (SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9 UNION SELECT 10 UNION SELECT 11 UNION SELECT 12 UNION SELECT 13 UNION SELECT 14 UNION SELECT 15 UNION SELECT 16 UNION SELECT 17 UNION SELECT 18 UNION SELECT 19 UNION SELECT 20 UNION SELECT 21 UNION SELECT 22 UNION SELECT 23 UNION SELECT 24 UNION SELECT 25 UNION SELECT 26 UNION SELECT 27 UNION SELECT 28 UNION SELECT 29 UNION SELECT 30 UNION SELECT 31 UNION SELECT 32 UNION SELECT 33 UNION SELECT 34 UNION SELECT 35 UNION SELECT 36 UNION SELECT 37 UNION SELECT 38 UNION SELECT 39 UNION SELECT 40 UNION SELECT 41 UNION SELECT 42 UNION SELECT 43 UNION SELECT 44 UNION SELECT 45 UNION SELECT 46 UNION SELECT 47 UNION SELECT 48 UNION SELECT 49 UNION SELECT 50 UNION SELECT
dolf@dolf-ThinkPad-T520:~/testgit$ git init
Initialized empty Git repository in /home/dolf/testgit/.git/
dolf@dolf-ThinkPad-T520:~/testgit$ nano readme
dolf@dolf-ThinkPad-T520:~/testgit$ echo foobar > readme
dolf@dolf-ThinkPad-T520:~/testgit$ git add readme
dolf@dolf-ThinkPad-T520:~/testgit$ git commit -m "foobar"
[master (root-commit) b1a97f2] foobar
1 file changed, 1 insertion(+)
create mode 100644 readme
dolf@dolf-ThinkPad-T520:~/testgit$ echo "foo bar" > readme
@Freeaqingme
Freeaqingme / strategy handling.php
Created July 18, 2012 22:01
THIS IS PSEUDOCODE
<?php
// tHIS ENTIRE FILE IS PSEUDOCODE ONLY
class ConsoleStrategy implements ListenerAggregateInterface
{
/**
* @var \Zend\Stdlib\CallbackHandler[]
*/
protected $listeners = array();
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Application;