Skip to content

Instantly share code, notes, and snippets.

View JoostK's full-sized avatar

Joost Koehoorn JoostK

View GitHub Profile
@JoostK
JoostK / PHP.tmLanguage
Last active December 19, 2015 21:38
Patched for namespace support in classnames. On OS X, go to Sublime menu -> Preferences -> Browse Packages. Then overwrite `PHP/PHP.tmLanguage` with the contents of this gist.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>comment</key>
<string>TODO:
• Try to improve parameters list syntax – scope numbers, ‘=’, ‘,’ and possibly be intelligent about entity ordering
• Is meta.function-call the correct scope? I've added it to my theme but by default it's not highlighted</string>
<key>fileTypes</key>
<array>
@JoostK
JoostK / php-anonymous-catch.diff
Created June 24, 2013 21:26
PHP Anonymous catches patch
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index faef3a9..ce675b1 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -2848,7 +2848,7 @@ void zend_do_mark_last_catch(const znode *first_catch, const znode *last_additio
{
CG(active_op_array)->last--;
zend_do_if_end(TSRMLS_C);
- if (last_additional_catch->u.op.opline_num == -1) {
+ if (!last_additional_catch || last_additional_catch->u.op.opline_num == -1) {
@JoostK
JoostK / KVCMethodsGenerator.php
Created July 24, 2010 15:29
Generates KVC compliant property accessors
<?php
define('_OBJC_CLASS', 'ClassName');
define('_OBJC_PROPERTY', 'propertyName');
class KVCMethodsGenerator {
private $_class;
private $_propertyName;
private $_ivar;
private $_ucfirstPropertyName;