Skip to content

Instantly share code, notes, and snippets.

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

ニート期間中のTODOリスト

外へ出よう

  • 北海道ぼっち旅行
    • だいたいの計画を立てる
    • 実行
  • 関西ぼっち旅行 体調的に諦めた
    • だいたいの計画を立てる 体調的に諦めた
View hoge.pl
# ()付けない
cmp_deeply $hoge, {
id => is_integer,
name => is_string,
};
# ()付ける
cmp_deeply $hoge, {
id => is_integer(),
name => is_string(),
View Array+Uniq.swift
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 Oct 27, 2015
`skintone.pl pray | pbcopy` で圧倒的感謝 🙏
View skintone.pl
#!/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;
View private.xml
<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>
View rxsample.py
# -*- 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 Aug 29, 2015
キーを変換しつつ新しいNSDictionaryを返すやつ
View NSDictionary+MBUtil.h
#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 Sep 8, 2013
pyenvに必要なパッケージ for Ubuntu
View require
sudo apt-get install libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev
@mihyaeru21
mihyaeru21 / Homebrew
Last active Dec 22, 2015
必要そうなやつ
View Homebrew
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
You can’t perform that action at this time.