Skip to content

Instantly share code, notes, and snippets.

Avatar

Yoshio HANAWA hnw

View GitHub Profile
View hoge999.php
<?php
abstract class Foo {
abstract public function func(int $y);
}
class Bar extends Foo {
public function func(int $y) {
return 1;
}
View log-localtime.go
package main
import (
"log"
"time"
)
func main() {
log.Fatalf("Now() = %s", time.Now())
View go1.8.3sf.diff
// -----------------------------------------------------------------------------
// To build softfloat enabled go binary, apply this patch to go1.8.3 source tree.
//
// $ patch -p1 <this file>
//
// And then, build like below.
//
// $ cd src
// $ GOROOT_BOOTSTRAP=<your_GOROOT> GOOS=linux GOARCH=misp GOMIPS=softfloat ./make.bash
//
View usleep.php
<?php
$sleep_time = 0;
$loop = 1000;
if (preg_match('/^(\d+)s$/', $argv[1])) {
$sleep_time = (int)$argv[1];
}
$usleep_time = (isset($argv[1]) && $argv[1] > 0) ? (int)$argv[1] : 1000;
if ($sleep_time > 0) {
printf("sleep%d\n", $sleep_time);
View recently-released-pecl-packages.txt
APCu
APM
Bitset
Druid
Mosquitto
PDO_IBM
PDO_INFORMIX
PDO_SQLANYWHERE
SeasLog
Weakref
View run-tests.php
#!/usr/bin/env php
<?php
/*
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2017 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
View gemtek.php
<?php
$manufacture = "敇瑭步挮浯䩟";
echo mb_convert_encoding($manufacture, "UTF-16LE", "UTF-8");
View hash-vs-in_array.php
<?php
$array_size =isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : 1024;
$access_loop = isset($_SERVER['argv'][2]) ? $_SERVER['argv'][2] : 16;
$usleep_time = 200000; // 200ms
$loop_for_accuracy = ($array_size >= 1024) ? 1 : (1024 / $array_size);
// 事前準備
for ($j = 0; $j < $loop_for_accuracy; $j++) {
for ($i = 0; $i < $array_size; $i++) {
View chanhop-mac.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 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"
You can’t perform that action at this time.