Skip to content

Instantly share code, notes, and snippets.

@kiyoto
kiyoto / github-scraper.php
Created March 28, 2012 06:17
github scraper. get user info for the users watching a particular repo
#!/usr/bin/env php
<?php
function get_watchers($login, $repo) {
$per_page = 100; // this is the max set by github http://developer.github.com/v3/#pagination
$page_number = 1;
$watchers = array();
while (1) {
$ch = curl_init(sprintf('https://api.github.com/repos/%s/%s/watchers?page=%d&per_page=%d',
@kiyoto
kiyoto / gist:1857431
Created February 18, 2012 04:36
openssl_decrypt bug patch
Index: ext/openssl/openssl.c
===================================================================
--- ext/openssl/openssl.c (revision 323312)
+++ ext/openssl/openssl.c (working copy)
@@ -4801,6 +4801,11 @@
base64_str = (char*)php_base64_decode((unsigned char*)data, data_len, &base64_str_len);
data_len = base64_str_len;
data = base64_str;
+
+ if (data == NULL) {
@kiyoto
kiyoto / php-bug-60668.diff
Created January 25, 2012 10:47
php bug 60668 fix
diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c
index a7ec5d7..89b1287 100644
--- a/Zend/zend_ini.c
+++ b/Zend/zend_ini.c
@@ -83,6 +83,23 @@ static int zend_restore_ini_entry_wrapper(zend_ini_entry **ini_entry TSRMLS_DC)
}
/* }}} */
+static uint zend_trim_after_carriage_return(char *value, uint value_length) /* {{{ */
+{