Skip to content

Instantly share code, notes, and snippets.

View reeze's full-sized avatar
🎯
Focusing

Reeze Xia reeze

🎯
Focusing
View GitHub Profile
{
:'pt-BR' => {
# formatos de data e hora
:date => {
:formats => {
:default => "%d/%m/%Y",
:short => lambda { |date| "#{date.day} %b" },
:long => lambda { |date| "#{date.day} de %B de %Y" },
:only_day => "%e"
git checkout origin/osx
HEAD is now at 77edf8d... Tidying up and an attempt to measure shared memory.
git checkout-index -af --prefix=/private/tmp/homebrew-htop-HEAD-9yJ0/
==> ./autogen.sh
./autogen.sh
glibtoolize: putting auxiliary files in `.'.
glibtoolize: copying file `./ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
glibtoolize: copying file `m4/libtool.m4'
glibtoolize: copying file `m4/ltoptions.m4'
@reeze
reeze / maximum_battery_life.md
Created March 20, 2012 08:16 — forked from mrflip/maximum_battery_life.md
maximum battery life checklist -- use before a long plane flight

Max Battery Life Checklist

Here is a checklist to follow if you want maximum battery life -- for instance if you're about to get on a long plane flight.

10 hour battery life on a non-SSD Macbook Pro 17"

Low power use checklist

With power connected:

@reeze
reeze / gist:2233132
Created March 29, 2012 03:51
git always have changed file
➜ Opensource git config --global core.autocrlf
false
➜ Opensource git clone https://github.com/php/php-src.git php-src-clean
Cloning into php-src-clean...
remote: Counting objects: 492188, done.
remote: Compressing objects: 100% (99071/99071), done.
remote: Total 492188 (delta 392149), reused 491908 (delta 391913)
Receiving objects: 100% (492188/492188), 108.91 MiB | 1.08 MiB/s, done.
Resolving deltas: 100% (392149/392149), done.
➜ Opensource cd php-src-clean
➜ Opensource git config --global core.autocrlf
input
➜ Opensource git clone https://github.com/php/php-src.git php-src-clean
Cloning into php-src-clean...
remote: Counting objects: 492188, done.
remote: Compressing objects: 100% (99071/99071), done.
remote: Total 492188 (delta 392149), reused 491908 (delta 391913)
Receiving objects: 100% (492188/492188), 108.91 MiB | 221 KiB/s, done.
Resolving deltas: 100% (392149/392149), done.
➜ Opensource cd php-src-clean
@reeze
reeze / gist:2599383
Created May 5, 2012 03:31
gdb symbol problem
➜ php-src git:(PHP-5.4) ✗ gdb sapi/cli/php
GNU gdb 6.3.50-20050815 (Apple version gdb-1705) (Fri Jul 1 10:50:06 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries ....... done
(gdb) b gc_zval_possible_root
@reeze
reeze / gist:2621860
Created May 6, 2012 11:53
possible typo
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index a3ed390..45c5f4a 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -1285,8 +1285,8 @@ static void php_cli_server_request_translate_vpath(php_cli_server_request *reque
struct stat sb;
static const char *index_files[] = { "index.php", "index.html", NULL };
char *buf = safe_pemalloc(1, request->vpath_len, 1 + document_root_len + 1 + sizeof("index.html"), 1);
- char *p = buf, *prev_patch = 0, *q, *vpath;
- size_t prev_patch_len;
@reeze
reeze / gist:3750131
Created September 19, 2012 15:00
Soapclient-test
<?php
$client = new SoapClient('http://www.webservicex.net/whois.asmx?WSDL');
$method = 'GetWhoIS';
$args = array('HostName' => 'reeze.cn');
var_dump($client->GetWhoIS(array('HostName' => 'reeze.cn')));
var_dump(call_user_func(array($client, $method), $args));
@reeze
reeze / gist:5076349
Last active December 14, 2015 10:59
sockets failed
==> ext/sockets/tests/mcast_ipv6_send.diff <==
013+
014+ Warning: socket_set_option(): unable to set socket option [49]: Can't assign requested address in /Users/reeze/Opensource/php-test/php-src-master/ext/sockets/tests/mcast_ipv6_send.php on line 26
015+ bool(false)
013- bool(true)
==> ext/sockets/tests/socket_cmsg_rights.diff <==
014+ int(24)
014- int(32)
018+ [name] => Array
019+ (
@reeze
reeze / gist:5101596
Created March 6, 2013 18:10
some test failure of non-scalar-key
==> ext/spl/tests/iterator_to_array_nonscalar_keys.diff <==
009+ [4612811918334230528]=>
009- [0]=>
==> ext/spl/tests/recursive_tree_iterator_001.diff <==
052+ [Thu Mar 7 02:03:17 2013] Script: '/Users/reeze/Opensource/php-master-test/ext/spl/tests/recursive_tree_iterator_001.php'
053+ /Users/reeze/Opensource/php-master-test/Zend/zend_execute_API.c(953) : Freeing 0x10857D940 (32 bytes), script=/Users/reeze/Opensource/php-master-test/ext/spl/tests/recursive_tree_iterator_001.php
054+ Last leak repeated 2 times
055+ === Total 3 memory leaks detected ===
==> ext/spl/tests/recursive_tree_iterator_005.diff <==
074+ [Thu Mar 7 02:03:17 2013] Script: '/Users/reeze/Opensource/php-master-test/ext/spl/tests/recursive_tree_iterator_005.php'