Skip to content

Instantly share code, notes, and snippets.

View kawahara's full-sized avatar

Shogo Kawahara (bucyou) kawahara

  • freee
  • Kyoto, Japan
  • 21:29 (UTC +09:00)
View GitHub Profile
<!DOCTYPE html>
<!--
Copyright (c) 2014 Rakuten, Inc
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@kawahara
kawahara / async.php
Created June 28, 2014 00:06
hacklang-async
<?hh
async function hoge() : Awaitable<void> {
var_dump('hoge1');
await SleepWaitHandle::create(1000000);
var_dump('hoge2');
}
async function run(): Awaitable<void> {
await GenArrayWaitHandle::create([hoge(), hoge()]);
@kawahara
kawahara / rakuten.html
Created July 12, 2014 04:13
Affiliate
<!DOCTYPE html>
<!--
Copyright (c) 2014 Rakuten, Inc
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
<?php
$fp = fopen(__DIR__.'/logs/access.log', 'a');
$headers = [];
foreach($_SERVER as $name => $value) {
if (preg_match('/^HTTP_.*/', $name)) {
$headers[$name] = $value;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="hello world example" />
<Content type="html"><![CDATA[
こんにちは世界
]]></Content>
</Module>
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="hello world example2" />
<Content type="html"><![CDATA[
こんにちは世界!!
]]></Content>
</Module>
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="hello world OSAPI">
<Require feature="opensocial-0.8" />
<Require feature="osapi" />
<Require feature="dynamic-height" />
</ModulePrefs>
<Content type="html"><![CDATA[
こんにちはだよ!!
<script type="text/javascript">
function url2cmd(url) {
if (!url.match(/^http:\/\/gist\.github\.com\/([0-9]+)/)) {
pne_url2a(url);
return;
}
var id = RegExp.$1;
main(id);
}
function main(id) {
Member:
<?php for($i = 0;$i < 100;$i++): ?>
test_member_<?php echo $i ?>:
id: ~
name: OpenPNE君<?php echo $i ?>号
is_active: 1
<?php endfor; ?>
MemberConfig:
first_member_mobile:
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Test Application">
<Require feature="opensocial-0.8" />
</ModulePrefs>
<Content type="html">
<![CDATA[
<div id="console"></div>
<script type="text/javascript">
function request() {