Skip to content

Instantly share code, notes, and snippets.

View matsubo's full-sized avatar

Yuki Matsukura matsubo

View GitHub Profile
@matsubo
matsubo / install.sh
Created May 2, 2013 11:25
SO-05d root kit (rootkitGXSX_1_137) install script for mac
#!/bin/bash
adb wait-for-device
adb push files/writeueventhelper_gxsx /data/local/tmp/
adb push files/onload.sh /data/local/tmp/
adb push files/getroot.sh /data/local/tmp/
adb push files/su /data/local/tmp/
adb push files/Superuser.apk /data/local/tmp/
adb push files/busybox /data/local/tmp/
@matsubo
matsubo / gist:5703039
Created June 4, 2013 01:55
PHP coding rule types. Quoted from php-cs-fixer option.
* indentation [PSR-2] Code must use 4 spaces for indenting, not tabs.
* linefeed [PSR-2] All PHP files must use the Unix LF (linefeed)
line ending.
* trailing_spaces [PSR-2] Remove trailing whitespace at the end of lines.
* unused_use [all] Unused use statements must be removed.
* phpdoc_params [all] All items of the @param phpdoc tags must be
javascript:document.getElementsByName('name')[0].value = document.getElementsByName('title')[0].value = document.getElementsByName('text')[0].value = 'hoge1'; document.getElementsByTagName('form')[0].submit();
(function(){
var total = {};
var year = '2012';
var all = false;
function init(num) {
if(typeof num !== 'number') {
num = 0;
$('<div/>').css({
position: 'fixed',
left: 0,
@matsubo
matsubo / array_vs_parse_ini.php
Created June 27, 2013 10:39
parse_ini_file is 10% faster than array.
<?php
$try = 100000;
$start = microtime(true);
for ($i=0; $i< $try; $i++) {
include('./config.php');
}
$end = microtime(true);
<?php
/**
* Create git daily release list group by author
*
* @author Yuki Matsukura
*/
class Git_Daily_List_Customize
{
/** @private string of github project url not containing the last slash */
private $github_project_url;
<?php
function benchmark(callable $block) {
$array = array();
for ($i = 0; $i < 10000; $i++) {
$array[] = mt_rand(1,1000000);
}
<?php
require __DIR__ . '/../vendor/autoload.php';
use DMM\Affiliate;
$dmm = new Affiliate('HnewL5HcLPsefmeUpzL0', 'pornjapan-990');
$dmm->setKeyword('スク水');
$array = $dmm->getResult();
@matsubo
matsubo / io.github.kazeburo.GrowthForecast.plist
Created December 30, 2013 03:58
.plist file for GrowthForecast daemon.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- Contains a unique string that identifies your daemon to launchd.
This key is required. -->
<key>Label</key>
<string>io.github.kazeburo.GrowthForecast</string>
@matsubo
matsubo / gist:8181358
Created December 30, 2013 12:04
WPtouch produced similar update query many times. 1st column: number of query 2nd column: query
14452 mysql-slow.log:UPDATE `wp_options` SET `option_value` = 'O:29:\"WPtouchDefaultSettingsBNCID30\":6:{s:5:\"bncid\";s:0:\"\";s:19:\"wptouch_license_key\";s:0:\"\";s:16:\"license_accepted\";b:0;s:21:\"license_accepted_time\";i:0;s:22:\"next_update_check_time\";i:1387075624;s:8:\"failures\";i:0;}' WHERE `option_ name` = 'wpts_bncid';
7135 mysql-slow.log:UPDATE `wp_options` SET `option_value` = 'O:29:\"WPtouchDefaultSettingsBNCID30\":6:{s:5:\"bncid\";s:0:\"\";s:19:\"wptouch_license_key\";s:0:\"\";s:16:\"license_accepted\";b:0;s:21:\"license_accepted_time\";i:0;s:22:\"next_update_check_time\";i:1387342604;s:8:\"failures\";i:0;}' WHERE `option_n ame` = 'wpts_bncid';
5061 mysql-slow.log:UPDATE `wp_options` SET `option_value` = 'O:29:\"WPtouchDefaultSettingsBNCID30\":6:{s:5:\"bncid\";s:0:\"\";s:19:\"wptouch_license_key\";s:0:\"\";s:16:\"license_accepted\";b:0;s:21:\"license_accepted_time\";i:0;s:22:\"next_update_check_time\";i:1388261031;s:8:\"failures\";i:0;}' WHERE `option_n ame` = 'wpts_bncid';
3774 mysql-slow