This file contains hidden or 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 query = new URLSearchParams({ key: value }); | |
fetch(`${this.url}?${query}`) | |
.then((response) => response.text()) | |
.then((text) => { | |
const dom = new DOMParser().parseFromString(text, "text/html"); | |
const next = dom.getElementById("id"); | |
const prev = document.getElementById("id"); | |
prev.replaceWith(next); | |
}); |
This file contains hidden or 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
function fetchRows(sheetName) { | |
var sheet = SpreadsheetApp.getActive().getSheetByName(sheetName); | |
var rows = sheet.getDataRange().getValues(); | |
var keys = rows.splice(0, 1)[0]; | |
return rows.map(function(row) { | |
var obj = {}; | |
row.map(function(item, index) { | |
obj[String(keys[index])] = String(item); | |
}); | |
return obj; |
This file contains hidden or 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
import { Controller } from "stimulus"; | |
export default class extends Controller { | |
forceUpperAlphaNumericAndHyphen(ev) { | |
let v = ev.currentTarget.value; | |
v = this.replaceFullWidthToHalf(v); | |
v = v.toUpperCase(); | |
v = this.filterByAlphaNumericAndHyphen(v); | |
ev.currentTarget.value = v; | |
} |
This file contains hidden or 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
{ | |
"Google (en)": { | |
"searchURL": "https://www.google.com/search?client=firefox-b-d&num=25&hl=en&q=%s", | |
"iconURL": "moz-extension://16dde075-4518-9045-a30e-fdad24679a7f/favicon.ico" | |
}, | |
"Google (ja)": { | |
"searchURL": "https://www.google.com/search?client=firefox-b-d&num=25&hl=ja&q=%s", | |
"iconURL": "moz-extension://16dde075-4518-9045-a30e-fdad24679a7f/favicon.ico" | |
}, | |
"eow.alc.co.jp": { |
This file contains hidden or 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
<?xml version="1.0"?> | |
<Project DefaultTargets="CopyFiles" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<ItemGroup> | |
<CopyFilesSourceFiles Include="$(IntermediateOutputPath)\*.dll"/> | |
<CopyFilesDestinationDirectory Include="hoge2"/> | |
</ItemGroup> | |
<Target Name="CopyFiles" AfterTargets="Build"> | |
<Message Text="@(CopyFilesSourceFiles->'%(Filename)%(Extension)')" /> | |
<Copy SourceFiles="@(CopyFilesSourceFiles)" DestinationFolder="@(CopyFilesDestinationDirectory)" SkipUnchangedFiles="true"/> | |
</Target> |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>version</key> | |
<integer>1</integer> | |
<key>keys</key> | |
<dict> | |
<key>before_typing</key> | |
<dict> |
This file contains hidden or 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
# Show current sleep settings | |
sudo systemsetup -getsleep | |
# Disable system sleep | |
sudo systemsetup -setcomputersleep Never | |
# Set 60min for sleep | |
sudo systemsetup -setcomputersleep 60 | |
# Help | |
sudo systemsetup -help |
This file contains hidden or 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
#!/usr/bin/env bash | |
set -eu | |
# 8GB | |
SECTORS=16777216 | |
DEV=$(hdiutil attach -nomount ram://${SECTORS}) | |
echo ${DEV} | |
diskutil erasevolume HFS+ 'Ramdisk' ${DEV} |
This file contains hidden or 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 -eu | |
if [ $# -ne 1 ]; then | |
echo "usage: $(basename $0) SPARSEBUNDLE_PATH" | |
exit 1 | |
fi | |
if [ ! -d $1 ]; then | |
echo $1 doesnt exists. >&2 |
This file contains hidden or 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 | |
# vim: set tabstop=2 softtabstop=2 shiftwidth=2 expandtab filetype=sh : | |
if [ $# -lt 1 ]; then | |
echo "usage: $(basename $0) <UNITY_EDITOR_URL>" >&2 | |
exit 1 | |
fi | |
EDITOR_URL=$(echo "$1" | sed -E 's/\?.*//') | |
HASH=$(echo ${EDITOR_URL} | sed -E 's/^.*\.unity3d\.com\/[a-z_]+\/([a-z0-9]+)\/.*/\1/') |
NewerOlder