Skip to content

Instantly share code, notes, and snippets.

View batako's full-sized avatar

batako

View GitHub Profile
@ethertank
ethertank / Array.prototype.js
Last active March 30, 2021 01:56
前に書いた ruby やらなんやらのメソッドを js に移植したコードのおまとめ。多分色々問題があるので来世でチェックする。
(function(AP) {
AP.fill || (AP.fill = function() {
if (arguments.length === 0) return this;
for (var r = this.slice(), i = arguments[1] || 0, l = (arguments[2] + arguments[1] || this.length - arguments[1] + 1) || this.length; i < l; ++i) {
r[i] = arguments[0];
}
return r;
});
@ethertank
ethertank / String.prototype.js
Last active March 30, 2021 01:57
String.prototype の拡張のおまとめ。
(function(SP) {
var _t = "[\x09-\x0D\x20\xA0\x85\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]+",
_l = new RegExp("^" + _t),
_r = new RegExp(_t + "$");
// polyfills
SP.trimLeft = function() { return this.replace(_l, ""); };
SP.trimRight = function() { return this.replace(_r, ""); };
SP.trim = function() { return this.trimLeft().trimRight(); };
@zabbarob
zabbarob / 7-zip-default-extract.reg
Last active January 13, 2025 15:09
WARNING: This gist is from 2013 and will likely no longer work with current versions of 7-Zip and Windows. - Make 7-Zip extract to folder when double-clicking archives.(based on http://superuser.com/a/447791)
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\7-Zip.001\shell]
@="extract"
[HKEY_CLASSES_ROOT\7-Zip.001\shell\extract]
@="Extract to Folder"
[HKEY_CLASSES_ROOT\7-Zip.001\shell\extract\command]
@="\"C:\\Program Files\\7-Zip\\7zG.exe\" x \"%1\" -o*"
[HKEY_CLASSES_ROOT\7-Zip.7z\shell]
@pkuczynski
pkuczynski / LICENSE
Last active November 19, 2025 14:34
Read YAML file from Bash script
MIT License
Copyright (c) 2014 Piotr Kuczynski
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWAR

マージ済みのリモートブランチを全て削除

git branch -r --merged master | grep -v -e master -e develop | sed -e 's% *origin/%%' | xargs -I% git push --delete origin %
  1. remote の master に merge済み の branch をすべて表示して
  2. master と develop は消えてほしくないので除外して
  3. origin/ を削除して
  4. xargs (-I% % で ブランチ名を渡しつつ、全て削除する)
@toriwasa
toriwasa / AutoHotKey.ahk
Last active November 5, 2024 01:43
手の移動距離を減らすためのAutoHotKeyスクリプト
;------------------------------------------------------------------------------
; 前提:
; 日本語, 英語キーボードどちらでも使用可能
; 英語キーボードの場合、変換・無変換キーが存在するUS配列として扱えるAX配列を利用する
; 参考:
; https://www.atmarkit.co.jp/ait/articles/0001/26/news001.html
; Change Key使用:
; 日本語キーボードの場合
; Caps Lock -> Ctrl
; 英語キーボードの場合
@shunirr
shunirr / criminal_jc.md
Last active June 21, 2025 08:07
女子中学生チケット詐欺事件

criminal_jc

@Prezens
Prezens / gist:f99fd28124b5557eb16816229391afee
Created April 2, 2019 07:40
Apache .htaccess settings for Vue, vue-router
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations