Skip to content

Instantly share code, notes, and snippets.

View Gasol's full-sized avatar
🥂
Hello strangers ~

Gasol Wu Gasol

🥂
Hello strangers ~
View GitHub Profile
@Gasol
Gasol / gist:978994
Created May 18, 2011 16:54
google-authentication configuration in debian squeeze
We couldn’t find that file to show.
@Gasol
Gasol / reflection.php
Created May 24, 2011 04:23
Using Reflection to get private property value in PHP
<?php
class A {
private $data;
public function setData($value)
{
$this->data = $value;
}
}
@Gasol
Gasol / parser2.diff
Created May 26, 2011 16:24
patch for phpdoc vim helptags parser
--- a/parser2.php 2011-05-27 00:07:45.515535000 +0800
+++ b/parser2.php 2011-05-26 16:37:01.081761000 +0800
@@ -344,14 +344,16 @@
//fwrite($fp, "!_TAG_FILE_SORTED 1\n");
fclose($fp);
-load_entities('phpdoc/entities/global.ent');
+load_entities('phpdoc/doc-base/entities/global.ent');
+load_entities('phpdoc/doc-base/entities/version.ent');
+load_entities('phpdoc/doc-base/entities/file-entities.ent');
gasol 韭 15
det 韭 15
gslin 玉 15
mendes 高 15
manic 高 15
webber 綜 20 貢丸湯
ronny 韭 15 魯肉飯
itsour 韭 15 魯肉飯
ken 玉 10 綜 10
jcrt 玉 20 高 10
@Gasol
Gasol / clothes.py
Created June 3, 2011 03:41
衣服size
clothes = dict()
clothes['M'] = ('gasol', 'webber', 'jcrt', 'mendes', 'sandy', 'elina', 'det', 'itsour', 'anties', 'jnlin', 'gslin')
clothes['L'] = ('manic', 'stephon', 'ronnywang', 'ken', 'repeat', 'yc')
clothes['XXXL'] = ('slzzp')
foods = dict()
foods['炭火燒烤雞腿飯'] = ('slzzp', 'mendes', 'gasol')
foods['炭火燒烤雞排飯'] = ('webber', 'stephon', 'ieon')
foods['炭火燒烤牛五花飯'] = ('itsour')
foods['烤Bar-B-Q牛肋條飯'] = ('jcrt')
foods['燒烤鯖魚飯'] = ('ken')
foods['燒烤松阪豬肉飯'] = ('manic', 'ychsiao', 'det')
foods['香橙烤鴨胸'] = ('ronnywang')
@Gasol
Gasol / strhex.c
Created June 26, 2011 11:39
Convert String to Hexidecimal
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
char* stringToHex(char *str)
{
int len = strlen(str);
char* buf = malloc(len * 2 + 1);
char* ret = buf;
int i;
@Gasol
Gasol / brew doctor
Created November 23, 2011 16:23
gpg install hangs
[pizza ~]$ brew doctor
/usr/bin/gcc
Your gcc 4.2.x version is older than the recommended version. It may be advisable
to upgrade to the latest release of Xcode.
@Gasol
Gasol / http_500_retry.irules
Created November 28, 2012 05:26
HTTP 500 retry
# Retry requests to the virtual server's default pool if the server responds with an error code (5xx status)
when CLIENT_ACCEPTED {
# On each new TCP connection track that we have not retried a request yet
set retries 0
# Save the name of the virtual server default pool
set default_pool [LB::server pool]
}
@Gasol
Gasol / 66470
Last active August 29, 2015 13:57
#0 0x00000000005450b0 in _zend_mm_free_int ()
#1 0x000000000055bc85 in _zval_ptr_dtor ()
#2 0x00000000004fcd7e in php_mysqlnd_res_free_buffered_data_pub ()
#3 0x00000000004fcc9d in php_mysqlnd_res_free_result_buffers_pub ()
#4 0x00000000004fbe9a in mysqlnd_internal_free_result_contents ()
#5 0x00000000004fe27a in mysqlnd_internal_free_result ()
#6 0x00000000004fd55f in php_mysqlnd_res_free_result_pub ()
#7 0x0000000807816102 in _free_mysql_result () from /usr/local/lib/php/20100525/mysql.so
#8 0x000000000057902e in list_entry_destructor ()
#9 0x00000000005760eb in zend_hash_apply_deleter ()