Skip to content

Instantly share code, notes, and snippets.

View kawahara's full-sized avatar

Shogo Kawahara (bucyou) kawahara

  • freee
  • Kyoto, Japan
  • 23:10 (UTC +09:00)
View GitHub Profile
@kawahara
kawahara / openapi.cue
Last active August 22, 2023 12:18
The cue definitions for openapi (3.0.3)
package definition
#openapi: {
openapi: "3.0.3"
info: #info
servers?: [...#server]
paths: #paths
components?: #components
security?: [...#security_requirement]
tags?: [...#tag]
const ArgumentType = require('../../extension-support/argument-type');
const BlockType = require('../../extension-support/block-type');
class MineCraft {
constructor () {
this.endpoint = 'http://localhost:8080/api/v5'
this.apiKey = null
this.worlds = []
this.players = []
this.player = null
(function(ext) {
ext._shutdown = function() {};
ext._getStatus = function() {
return {status: 2, msg: 'Ready'};
};
ext.get_weather = function(callback) {
$.ajax({
url: 'http://api.openweathermap.org/data/2.5/weather?q=Kashiwa,%20JP&units=imperial&APPID=fa4bc3cd05fcedff03fcec2db6bb2a4f',
// ==UserScript==
// @name GitHub Compare Button
// @namespace http://tampermonkey.net/
// @version 0.1
// @description This script can add compare button to GitHub commit log.
// @author Shogo Kawahara <kawahara@bucyou.net>
// @match https://github.com/*
// @grant none
// ==/UserScript==
/* jshint -W097 */
<?php
$fp = fopen(__DIR__.'/logs/access.log', 'a');
$headers = [];
foreach($_SERVER as $name => $value) {
if (preg_match('/^HTTP_.*/', $name)) {
$headers[$name] = $value;
}
}
@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:
@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()]);
<!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:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<form id="search-form">
<input id="keyword" name="keyword" value="" required>
<input type="submit" value="検索">
</form>
@kawahara
kawahara / Gemfile
Last active December 22, 2015 23:39
source 'https://rubygems.org'
gem 'httpclient'