Skip to content

Instantly share code, notes, and snippets.

View youcune's full-sized avatar

なかにしゆう youcune

View GitHub Profile
@youcune
youcune / romantable.txt
Last active March 19, 2024 01:37
AZIK配列のいつも使うGoogle日本語入力用ローマ字テーブル
~ ~
, 、
. 。
/ ・
: ー
; っ
[ 「
] 」
a あ
ba ば
@youcune
youcune / notion.json
Created August 23, 2021 02:30
Notion Mac AppでCmd+[, Cmd+] でインデントできるようにするKarabiner-ElementsのComplex Modificationsファイル
{
"title": "Notion",
"rules": [
{
"description": "[Notion] Command+[ to Shift+Tab",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "open_bracket",
@youcune
youcune / bookmarklet.js
Last active June 10, 2021 08:28
onpasteを削除するJavaScriptブックマークレット
javascript:'use%20strict';const%20_inputs=document.getElementsByTagName(%22input%22);for(const%20a%20of%20_inputs)a.onpaste=null;
@youcune
youcune / fadein.html
Created August 24, 2014 12:23
CSS3 のみで display: none からフェードインさせる
<!DOCTYPE html>
<html>
<head>
<meta charst='utf-8'>
<title>TEST</title>
<script src="//code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script>
<style>
.box {
background: #000000;
display: none;
@youcune
youcune / 06.rb
Created October 30, 2019 11:16
言語処理100本ノック2015
require 'set'
def bigram(str)
size = str.size
Set.new.tap do |result|
0.upto(size-2) do |i|
result << str[i, 2]
end
end
end
@youcune
youcune / facebook-remove-cta.user.js
Created April 7, 2017 06:11
Facebookにログインしていない状態で出てくるクソデカくてウザいログインしようぜポップアップを表示させなくするユーザースクリプト
// ==UserScript==
// @name Facebook Remove CTA
// @namespace jp.youcube.facebook-remove-cta
// @include https://www.facebook.com/*
// @version 1
// @grant none
// ==/UserScript==
elm = document.getElementById('pagelet_growth_expanding_cta');
if (elm != null) {
@youcune
youcune / area.rb
Last active October 23, 2016 08:13
ActiveHashを用いた都道府県マスタ
class Area < ActiveHash::Base
self.data = [
{ id: 1, name: '北海道', name_english: 'hokkaido' },
{ id: 2, name: '東北', name_english: 'tohoku' },
{ id: 3, name: '関東', name_english: 'kanto' },
{ id: 4, name: '中部', name_english: 'chubu' },
{ id: 5, name: '関西', name_english: 'kansai' },
{ id: 6, name: '中国', name_english: 'chugoku' },
{ id: 7, name: '四国', name_english: 'shikoku' },
{ id: 8, name: '九州', name_english: 'kyushu' },
@youcune
youcune / to_hex.rb
Last active October 1, 2016 01:48
Rubyプログラミングキャンプ2016の課題
#!/usr/bin/env ruby
def to_hex(*args)
raise ArgumentError, '0-255の範囲のIntegerで指定してね' if args.any? { |_| !_.kind_of?(Integer) || !(0..255).include?(_) }
"##{args.map { |_| '%02x' % _ }.join}"
end
# test
p to_hex(0, 0, 0)
p to_hex(15, 16, 255)
@youcune
youcune / Lucida Grande+ヒラギノ角ゴ.xml
Created January 8, 2014 02:32
これを ~/Library/Application Support/Microsoft/Office/ユーザー テンプレート/個人用テーマ/Theme Fonts に設置すると、Mac版PowerPointでヒラギノ角ゴをデフォルトフォントにしたテーマが使えます。 参考 http://irritantis.info/2013/08/font_pattern_for_mac_powerpoint_theme/
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<a:fontScheme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Lucida Grande+ヒラギノ角ゴ"><a:majorFont><a:latin typeface="Lucida Grande"/><a:ea typeface="ヒラギノ角ゴ ProN"/><a:cs typeface=""/></a:majorFont><a:minorFont><a:latin typeface="Lucida Grande"/><a:ea typeface="ヒラギノ角ゴ ProN"/><a:cs typeface=""/></a:minorFont></a:fontScheme>
@youcune
youcune / pre-commit
Last active January 1, 2016 06:49
git commitしたときに全角チルダが含まれていたらコミットを拒否する。EUC/UTF-8対応。Windowsで見ると全角チルダが化けてしまうためチェックスクリプト化しました。.git/hooks/pre-commitに設置して使います。
#!/usr/bin/env perl
# git commitしたときに全角チルダが含まれていたらコミットを拒否する
# \x8F\xA2\xB7 : EUC-JPで全角チルダ
# \xEF\xBD\x9E : UTF-8で全角チルダ
use strict;
use warnings;
our @files = `git diff-index --name-status HEAD | cut -c3-`;