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
if (~window.navigator.userAgent.indexOf('Trident')) { | |
location.href = 'https://getfirefox.com'; | |
} |
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 -euC | |
# set -o pipefail | |
# exec 5>> /tmp/xmosh/shell-script-debug.out | |
# BASH_XTRACEFD="5" | |
# PS4='$LINENO: ' | |
# set -x |
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 | |
GLOB='**/*.md *.txt' | |
set -o noglob | |
p-args $GLOB | |
echo '' | |
set +o noglob |
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
function upload () { | |
local src="$1" | |
# ... | |
mv "$temp" "$src" | |
clean_src () { | |
rm "$src" | |
} | |
trap clean_src EXIT |
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
iabbr dog cat |
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
#include <stdio.h> | |
#include <stdlib.h> | |
int main(int argc, char *argv[]) { | |
if (0 < argc) { | |
printf("%d\n", main(-argc, argv)); | |
return 0; | |
} | |
if (-argc - 1) { |
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
// tone.h Final Countdown melody https://forum.arduino.cc/index.php?topic=202387.0 | |
#include "TM1637.h" | |
#include <avr/sleep.h> | |
#define BUZZER_PIN 12 | |
#define WAKEUP_PIN 2 | |
#define SUB_WAKEUP_PIN 3 | |
#define NANA_SEG_CLK 10 |
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
cancel = !git commit --no-verify -a -m \"Temporary commit for cancel at `date`\" && git reset --hard HEAD~ |
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
" 自動で YAML に変換して書きだす (*.x.yaml とすること) {{{ | |
function! s:yaml_to_json() | |
let l:from = expand('%') | |
let l:to = expand('%:r:r') . '.json' | |
let l:result = system('ruby -rjson -ryaml -e "puts(JSON.pretty_generate(YAML.load(ARGF.read)))" ' . shellescape(l:from) . ' > ' . shellescape(l:to)) | |
if v:shell_error | |
echoerr printf("Failed to yaml_to_json: %d\n%s", v:shell_error, l:result) | |
endif | |
endfunction |
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
'35'.unpack('S') |