Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am snipsnipsnip on github.
  • I am snipsnipsnip (https://keybase.io/snipsnipsnip) on keybase.
  • I have a public key ASBtfx30sf4UHCm1Pzws-X8nQCm4Idw9qV9N6NTfLGrchgo

To claim this, I am signing this object:

@snipsnipsnip
snipsnipsnip / chrome-i18n.js
Last active January 11, 2020 11:37 — forked from eligrey/chrome-i18n.js
Easy i18n for your Chrome extensions and apps' DOM.
/*
* A cut-down i18n utility. @snipsnipsnip
* Based on Chrome DOM i18n By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
"use strict";
for (let e of document.querySelectorAll("[data-i18n]")) {
@snipsnipsnip
snipsnipsnip / kill-steamvr.bat
Created August 6, 2019 03:26
kill-steamvr.bat
@taskkill /f /im vr*
@snipsnipsnip
snipsnipsnip / autozip.rb
Created June 9, 2019 13:16
autozip.rb is a 7za wrapper extracts/archives any zips/folders (respectively) put in the working directory
# frozen-string-literal: true
require 'fileutils'
require 'shellwords'
require 'date'
Outdir = 'out'
def run(cmd)
puts "!#{cmd}"
system cmd
@snipsnipsnip
snipsnipsnip / trac-update-field.py
Last active April 20, 2019 09:19
trac-update-field.py writes a single field with xmlrpc
from __future__ import annotations
from xmlrpc.client import Transport, ServerProxy
import sys
import typing
if typing.TYPE_CHECKING:
import http.client
from typing import Dict, List, Tuple, Optional
@snipsnipsnip
snipsnipsnip / perm.rb
Last active September 4, 2019 11:20
perm.rb: explodes ARGV as a TSV (permutate 'foo bar baz' 'quu qux' yields 6 lines)
# frozen_string_literal: true
# permutate.rb: MIT license. @snipsnipsnip
require 'csv'
require 'optparse'
require 'shellwords'
def main(argv=ARGV)
filter = nil
rest = nil
need_header = false
@snipsnipsnip
snipsnipsnip / SomeMFCControl.cs
Last active May 19, 2018 10:51
MFCの部品をWindows.Forms.Formに埋め込む ref: https://qiita.com/snipsnipsnip/items/19045907ae96121e8310
public class GuestControl : Control
{
/// <summary>アタッチしたMFCのCWnd</summary>
private IntPtr CWnd { get; }
[DllImport("attach")]
private static extern IntPtr attach(IntPtr hwnd);
[DllImport("attach")]
private static extern void detach(IntPtr hwnd);
@snipsnipsnip
snipsnipsnip / file5.txt
Last active May 14, 2020 10:34
git rebase --interactive でコミットの見分けがつかない問題の対策 ref: https://qiita.com/snipsnipsnip/items/8e4244b4fff2a5a2bc32
$ git reset --hard E # git reset --hard origin/devel でも可
$ git cherry-pick -n D A
$ git commit -m "DとA"
$ git cherry-pick B
$ git cherry-pick C
@snipsnipsnip
snipsnipsnip / file0.txt
Created December 14, 2017 14:50
「クラスを抽出」というリファクタリングがあるとしたらどういうものだろうか ref: https://qiita.com/snipsnipsnip/items/3a8d018d683d2c54ea15
interface R {
$(D1)
$(V1)
}
@snipsnipsnip
snipsnipsnip / 設定
Created June 8, 2017 13:13
htpasswd/htdigestファイルのままJenkinsのBasic認証をやめる ref: http://qiita.com/snipsnipsnip/items/6ee0d8cf8219fad2e696
/usr/bin/ruby -rwebrick/httpauth/htdigest -e 'D = WEBrick::HTTPAuth::Htdigest.new(ARGV[0]); D.get_passwd(ARGV[1], ENV["U"], false) == D.make_passwd(ARGV[1], ENV["U"], ENV["P"]) or abort' /var/www/.htdigest realm