Skip to content

Instantly share code, notes, and snippets.

Avatar

Yoshio HANAWA hnw

View GitHub Profile
View huge-immutable-array.php
This file has been truncated, but you can view the full file.
<?php
function foo($bar) {
$arr = [
"x1"=>["foo"=>1,"bar"=>1,"baz"=>3,"qux"=>4,"quux"=>5,"corge"=>6,"grault"=>7,"garply"=>8,"waldo"=>9,"fred"=>10,"plugh"=>11,"xyzzy"=>12,"thud"=>13],
"x2"=>["foo"=>2,"bar"=>1,"baz"=>3,"qux"=>4,"quux"=>5,"corge"=>6,"grault"=>7,"garply"=>8,"waldo"=>9,"fred"=>10,"plugh"=>11,"xyzzy"=>12,"thud"=>13],
"x3"=>["foo"=>3,"bar"=>1,"baz"=>3,"qux"=>4,"quux"=>5,"corge"=>6,"grault"=>7,"garply"=>8,"waldo"=>9,"fred"=>10,"plugh"=>11,"xyzzy"=>12,"thud"=>13],
"x4"=>["foo"=>4,"bar"=>1,"baz"=>3,"qux"=>4,"quux"=>5,"corge"=>6,"grault"=>7,"garply"=>8,"waldo"=>9,"fred"=>10,"plugh"=>11,"xyzzy"=>12,"thud"=>13],
"x5"=>["foo"=>5,"bar"=>1,"baz"=>3,"qux"=>4,"quux"=>5,"corge"=>6,"grault"=>7,"garply"=>8,"waldo"=>9,"fred"=>10,"plugh"=>11,"xyzzy"=>12,"thud"=>13],
"x6"=>["foo"=>6,"bar"=>1,"baz"=>3,"qux"=>4,"quux"=>5,"corge"=>6,"grault"=>7,"garply"=>8,"waldo"=>9,"fred"=>10,"plugh"=>11,"xyzzy"=>12,"thud"=>13],
View opcache-bug-for-huge-array.php
<?php
function foo($bar) {
return [
"x1"=>1,
"x2"=>1,
"x3"=>1,
"x4"=>1,
"x5"=>1,
"x6"=>1,
"x7"=>1,
View chanhop.sh
#!/bin/bash
# Channel hopping shell script
# GPLv2
# Portions of code graciously taken from Bill Stearns defragfile
# http://www.stearns.org/defragfile/
#
# jwright@hasborg.com
# Defaults
BANDS="IEEE80211B"
View 1092104.json
{
"title": "Use Japanese Keyboard as US Keyboard",
"rules": [
{
"description": "Ctrl+@ to Escape",
"manipulators": [
{
"type": "basic",
"conditions": [
{
View diff-unixtime2tm-c.txt
*** ext/date/lib/unixtime2tm.c~ 2019-08-28 12:01:15.000000000 +0900
--- ext/date/lib/unixtime2tm.c 2019-12-11 20:37:52.000000000 +0900
***************
*** 56,61 ****
--- 56,67 ----
cur_year += YEARS_PER_LYEAR_PERIOD * (tmp_days / DAYS_PER_LYEAR_PERIOD);
tmp_days -= DAYS_PER_LYEAR_PERIOD * (tmp_days / DAYS_PER_LYEAR_PERIOD);
}
+ printf("tmp_days=%lld, year=%lld\n", tmp_days, cur_year);
+ if (ts >= 0 && tmp_days == 0) {
View ptraceの第一引数の説明(必要なものだけ抜粋)
●PTRACE_ATTACH
pid で指定されたプロセスに接続 (attach) し、それを現在のプロセスの子プ
ロセスとしてトレースできるようにする。子プロセスは PTRACE_TRACEME した
かのように振舞う。現在のプロセスはそのほとんどの目的において、 その子プ
ロセスの実際の親になる (例えば、子プロセスのイベントの 通知を受けとった
り、 ps(1) で親として表示されたりする)。しかし、子プロセスで
getppid(2) を実行した場合には元の親プロセスの PID が返される。 子プロセ
スには SIGSTOP が送られるが、この呼び出しが完了するまでに 必ずしも停止
するとは限らない。子プロセスの停止を待つには wait(2) を使用すること。
View hoge.md
{
   "foo": [3,4,5]
}
View 1092104.json
{
"title": "Use Japanese Keyboard as US Keyboard (rev 1)",
"rules": [
{
"description": "Ctrl+@ to Escape",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "open_bracket",
View 1092104.json
{
"title": "Remap Japanese Keyboard to US (rev 1)",
"rules": [
{
"description": "Ctrl+@ to Escape",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "open_bracket",
View 1092104.json
{
"title": "Remap Japanese Keyboard to US",
"rules": [
{
"description": "Ctrl+@ to Escape",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "open_bracket",
You can’t perform that action at this time.