Skip to content

Instantly share code, notes, and snippets.

View mpyw's full-sized avatar
🏠
Working from home

mpyw mpyw

🏠
Working from home
View GitHub Profile
@isuzuki
isuzuki / .php_cs
Last active June 7, 2025 09:54
Config for PHP-CS-Fixer ver 2 (based on laravel .php_cs https://github.com/laravel/framework/blob/5.4/.php_cs)
<?php
/**
* Config for PHP-CS-Fixer ver2
*/
$rules = [
'@PSR2' => true,
// addtional rules
@mapk0y
mapk0y / 01_memo.md
Last active May 24, 2022 08:59
docker build 時に特定のディレクトリのコピーだけ除外したい

やりたいこと

手元のディレクトリが次のような構成で

./app
├── index.html
├── bar
│   └── hoge
└── foo
--
-- for command line osascript ./vpn_run.scpt and add permission to "security & privacy"
--
activate application "Cisco AnyConnect Secure Mobility Client"
tell application "System Events"
repeat until window 1 of process "Cisco AnyConnect Secure Mobility Client" exists
end repeat
tell process "Cisco AnyConnect Secure Mobility Client"
@ykst
ykst / lua-nginx-cheatsheet.md
Last active February 7, 2024 15:17
逆引きlua-nginx-module
@jarretmoses
jarretmoses / React Native Clear Cache
Last active April 23, 2025 11:20
Clearing the Cache of your React Native Project
RN < 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.50 - watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >= 0.63 - watchman watch-del-all && rm -rf node_modules && npm install && rm -rf /tmp/metro-* && npm run start --reset-cache
npm >= 5 - watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache
Windows - del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache
@k16shikano
k16shikano / zundoko.tex
Created March 15, 2016 04:02
zundoko.tex
\documentclass[dvipdfmx]{jsarticle}
\usepackage{xcolor}
\usepackage[noalphabet]{pxchfon}
\setminchofont{Oradano.ttf}
\usepackage[first=1, last=3]{lcg}
\makeatletter
\newcount\LastFive
@petericebear
petericebear / .php_cs
Last active July 25, 2025 18:20
Laravel 5.x php-cs-fixer config file
<?php
$finder = Symfony\Component\Finder\Finder::create()
->notPath('bootstrap/cache')
->notPath('storage')
->notPath('vendor')
->in(__DIR__)
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
@gaogao-9
gaogao-9 / Promise.js
Last active October 30, 2021 19:18
正しいPromise.reverseとPromise.anyの実装例
Promise.reverse = function reverse(promise){
// 範囲を広げるために、一応instanceof Promiseではなく、thenableを通すようにしてる。
switch(true){
case (typeof(promise) !== "object"):
case (promise === null):
case (typeof(promise.then) !== "function"):
return Promise.reject(promise);
}
return promise.then((data)=> Promise.reject(data), (err)=> Promise.resolve(err));
@anjan011
anjan011 / generate-hidden-inputs-from-array.php
Last active September 20, 2019 02:58
php: generate html hidden input elements from a php array
<?php
/**
* Convert an array of data into a list of html hidden input fields, using the
* array keys as name and values a input values.
*
* @param array $data Array of data
* @param string $namePrefix Name prefix for hidden controls
*
@gaogao-9
gaogao-9 / asyncDOMContentLoaded.js
Last active March 17, 2016 11:15
async/await等で頻繁に利用する待機可能なPromiseパターンを予めパッケージ化してしまえば便利かなーと思いましたので、色々作っておきました。
import asyncSleep from "./asyncSleep.js";
function asyncDOMContentLoaded(target=window, timeout=10000){
if(target.document.readyState !== "loading"){
return Promise.resolve({ target, data: null });
}
return Promise.race([
asyncSleep(timeout).then(Promise.reject(new Error("asyncDOMContentLoaded is timeout"))),
new Promise((resolve, reject)=>{