Skip to content

Instantly share code, notes, and snippets.

name: main
on:
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
<?php
declare(strict_types=1);
$files = []; // glob か何かでファイルのリストを取得
foreach ($files as $file) {
$source = file_get_contents($file);
$refactoring = new Refactoring($source);
$refactoring->addDeclare();
file_put_contents($file, $refactoring->toString());
}
@SnowCait
SnowCait / Journey.md
Last active March 22, 2020 01:18
旅行

旅行

持ち物

  • MacBook
    • USB-C ケーブル
    • AC アダプター
    • USB-C アダプター
  • iPhone
<?php
declare(strict_types=1);
$debug = true;
$save_columns = [
'Adventurers' => [
'Id',
'Name',
'NameJP',
{
"errorType": "Error",
"errorMessage": "Client network socket disconnected before secure TLS connection was established",
"code": "ECONNRESET",
"stack": [
"Error: Client network socket disconnected before secure TLS connection was established",
" at TLSSocket.onConnectEnd (_tls_wrap.js:1092:19)",
" at Object.onceWrapper (events.js:286:20)",
" at TLSSocket.emit (events.js:203:15)",
" at endReadableNT (_stream_readable.js:1129:12)",
@SnowCait
SnowCait / OAuthStandard.cs
Created July 23, 2019 01:56
Twitter API over .NET Standard
// Twitter API over .NET Standard
//
// using OAuthStandard https://github.com/cjhoward92/OAuthStandard
// using HttpClient https://docs.microsoft.com/ja-jp/dotnet/api/system.net.http.httpclient?view=netstandard-2.0
// using .NET Core 3.0
// using C# 8.0
//
// NuGet
// PM> Install-Package OAuthStandard -Version 1.0.0
<!DOCTYPE slide>
<slide lang="ja">
<head>
<page>
<title></title>
<date></date>
<author>
<name>雪猫</name>
<account platform="twitter" href="https://twitter.com/snow_cait">@snow_cait</account>
</author>
@SnowCait
SnowCait / Main.cs
Last active June 14, 2019 19:58
Twitter Client
class Main
{
public void async AuthorizedUser()
{
var client = new TwitterClient("CK", "CS");
client.Authorize("AT", "ATS");
await CallApiAsync();
}
public void async AuthorizePinCode()
@SnowCait
SnowCait / csv2json.php
Created April 13, 2019 21:00
CSV to JSON convert on PHP
<?php
$path = '/path/to/example.csv';
$name = basename($path, '.csv');
// https://www.php.net/manual/ja/function.str-getcsv.php#114764
$csv = array_map('str_getcsv', file($path));
$header = array_shift($csv);
$data = array_map(function ($row) use ($header) {
return array_combine($header, array_map(function ($value) {
if ($value === 'TRUE') { return true; }
@SnowCait
SnowCait / SmartPhone.md
Created February 21, 2019 00:31
スマホ開発

スマホ開発

OS

  • Android >=5.0
  • iOS >=10.0