This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// const q = (s,r)=>[...(r||document).querySelectorAll(s)]; | |
const q = (selector,root) => | |
selector.split(/::shadow\s*/) | |
.reduce((parents,selector,idx) => | |
parents.flatMap(parent => | |
selector=="" ? (idx==0?parent:parent.shadowRoot) : [...(idx==0?parent:parent.shadowRoot).querySelectorAll(selector)] | |
) | |
, [root||document] | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
set -o pipefail | |
t=$(mktemp -d -p "${TMPDIR:-/tmp/}" -t build-qpac.XXXXXXXXXX) | |
dist="$t/dist" | |
build="$t/build" | |
yum install -y gcc zlib-devel | |
git clone --depth=1 https://github.com/gpac/gpac.git "$build" | |
cd "$build" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const FUNC_PATH = '/search-iphone'; | |
const FROM = '+8150XXXXXXXX'; //Twilioで購入済みの電話番号 | |
//電話番号リスト。冗長だけどとりあえずキーワード複数に同じ番号を定義しとく | |
const TO_NUMBERS = { | |
'お父さん': '+8190XXXXXXXX', | |
'父さん': '+8190XXXXXXXX', | |
'お母さん': '+8190YYYYYYYY', | |
'母さん': '+8190YYYYYYYY', | |
}; | |
//電話に出たときに再生されるメッセージ(適当) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Qiita記事 https://qiita.com/kawaz/items/0593163c1c5538a34f6f | |
set -e | |
set -o pipefail | |
# pam_tidの存在チェック(間違えてLinux環境などで実行されたら中断する) | |
[[ -f /usr/lib/pam/pam_tid.so.2 ]] || exit 1 | |
[[ "${OSTYPE:0:6}" == "darwin" ]] || exit 1 | |
# /etc/pam.d/sudo の修正 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -sL https://raw.githubusercontent.com/nodejs/Release/master/schedule.json | jq --arg today "$(date -u +%Y-%m-%d)" ' | |
. as $a | keys | map({release:.}+$a[.]) | sort_by(.start) | reverse | | |
{ | |
pending: map(select(.start>$today)), | |
current: map(select(.start<=$today and .lts==null))[0:1], | |
active_lts: map(select(.lts and .lts<=$today and .maintenance>$today)), | |
maintenance_lts: map(select(.lts and .lts<=$today and .maintenance<=$today and .end>$today)), | |
end: map(select(.end<=$today)) | |
}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
latest_zip=$(curl -sL https://api.github.com/repos/yuru7/HackGen/releases/latest | jq -r '.assets|map(select(.name|test("^HackGen_v.*\\.zip$")))[].browser_download_url') | |
d=$(mktemp -d "${TMPDIR:-/tmp}/${1:-install-fonts-HackGen.sh}.XXXXXXXXXX") | |
curl -sL "$latest_zip" | tar xz -C "$d" | |
mv "$d"/*.ttf ~/Library/Fonts | |
rm -rf "$d" | |
fc-cache -vf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/EventOverview/TextDefaultsBindings/TextDefaultsBindings.html | |
// ^ for Control | |
// $ for Shift | |
// ~ for Option | |
// @ for Command | |
// # for numeric keypad | |
{ | |
// home/end | |
"\UF729" = "moveToBeginningOfLine:"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:18.04 | |
RUN apt-get update && \ | |
apt-get upgrade -y | |
RUN apt-get update && \ | |
apt-get install -y \ | |
bluetooth \ | |
bluez \ | |
cmake \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
username='[email protected]' | |
password='apple-id-no-password' | |
authheader="Authorization: Basic $(echo -n "$username:$password" | base64)" | |
url_initClient="https://fmipmobile.icloud.com/fmipservice/device/$username/initClient" | |
url_playSound="https://fmipmobile.icloud.com/fmipservice/device/$username/playSound" | |
# initClient | |
curl -vXPOST "$url_initClient" -H "$authheader" > initClient.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package cfn | |
Template:: close({ | |
AWSTemplateFormatVersion?: "2010-09-09" | |
Transform?: string | [...string] | |
Description?: string | |
Metadata?: [string]: Value | |
Parameters?: [string]: Parameter | |
Mappings?: [string]: [string]: [string]: _ | |
Conditions?: [string]: Condition |