Skip to content

Instantly share code, notes, and snippets.

@mihyaeru21
mihyaeru21 / rule.json
Last active August 3, 2017 17:18
<C-[>でIMEオフにもするkarabiner.jsonのrule
{
"description": "Change `<C-[>` to `<C-[> + IME off` in some apps.",
"manipulators": [
{
"from": {
"key_code": "open_bracket",
"modifiers": {
"mandatory": [
"control"
],

ニート期間中のTODOリスト

外へ出よう

  • 北海道ぼっち旅行
    • だいたいの計画を立てる
    • 実行
  • 関西ぼっち旅行 体調的に諦めた
  • だいたいの計画を立てる 体調的に諦めた
# ()付けない
cmp_deeply $hoge, {
id => is_integer,
name => is_string,
};
# ()付ける
cmp_deeply $hoge, {
id => is_integer(),
name => is_string(),
@mihyaeru21
mihyaeru21 / Array+Uniq.swift
Created November 7, 2015 14:47
make Array unique
extension Array {
func uniqBy<KeyType: Hashable>(@noescape hash: (Element) -> KeyType) -> [Element] {
var seen: [KeyType: Bool] = [:]
return self.filter { element in
let key = hash(element)
if seen[key] == nil {
seen[key] = true
return true
}
return false
@mihyaeru21
mihyaeru21 / skintone.pl
Last active October 27, 2015 09:43
`skintone.pl pray | pbcopy` で圧倒的感謝 🙏
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
exit 1 unless @ARGV;
my $emoji = ":$ARGV[0]:";
print join ' ', $emoji, map { "$emoji:skin-tone-$_:" } 2..6;
<item>
<name>Option_L to Command_L</name>
<appendix>(+ When you type Option_L only, send EISUU)</appendix>
<identifier>private.optl2cmdl_eisuu</identifier>
<autogen>__KeyOverlaidModifier__ KeyCode::OPTION_L, KeyCode::COMMAND_L, KeyCode::JIS_EISUU</autogen>
</item>
<item>
<name>Option_R to Command_R</name>
<appendix>(+ When you type Option_L only, send KANA)</appendix>
<identifier>private.optr2cmdr_kana</identifier>
# -*- coding: utf-8 -*-
from __future__ import print_function
from rx import Observable
(Observable.from_(range(1, 10))
.map(lambda x: x ** 2)
.filter(lambda x: x % 2 == 0)
.subscribe(
on_next = print,
@mihyaeru21
mihyaeru21 / NSDictionary+MBUtil.h
Last active August 29, 2015 14:12
キーを変換しつつ新しいNSDictionaryを返すやつ
#import <Foundation/Foundation.h>
@interface NSDictionary (MBUtil)
- (instancetype)initWithDictionary:(NSDictionary *)dictionary withKeyDictionary:(NSDictionary *)keyDictionary;
+ (instancetype)dictionaryWithDictionary:(NSDictionary *)dictionary withKeyDictionary:(NSDictionary *)keyDictionary;
@end
@mihyaeru21
mihyaeru21 / require
Created September 8, 2013 17:05
pyenvに必要なパッケージ for Ubuntu
sudo apt-get install libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev
@mihyaeru21
mihyaeru21 / Homebrew
Last active December 22, 2015 14:18
必要そうなやつ
brew install zsh git vim macvim openssl tree gnuplot the_silver_searcher tmux pyenv plenv perl-build rbenv ruby-build zsh-completions reattach-to-user-namespace ghostscript imagemagick