This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include "uthash.h" | |
typedef enum { | |
kJigokuTileFlagNone = 0, | |
kJigokuTileFlagCollision = (1 << 0), | |
kJigokuTileFlagCharacter = (1 << 1), | |
kJigokuTileFlagItem = (1 << 2), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# \e[XX;Ym | |
# 3X for foreground, 4X for background | |
# 0:black,1:red,2:green,3:yellow,4:blue,5:magenta,6:cyan,7:white | |
# ;0/;1 for regular/bold | |
# \[...\] needed to tell bash to ignore in calculating length | |
prompt_c_grey='\[\e[30;1m\]' | |
prompt_c_green='\[\e[32;1m\]' | |
prompt_c_yellow='\[\e[33;1m\]' | |
prompt_c_blue='\[\e[34;1m\]' | |
prompt_c_magenta='\[\e[35;1m\]' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890"!`?'.,;:()[]{}<>|/@\^$-%+=#_&~*ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890"!`?'.,;:()[]{}<>|/@\^$-%+=#_&~* あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよわをんアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨワヲン一右雨円王音下火花貝学気九休玉金空月犬見五口校左三山子四糸字耳七車手十出女小上森人水正生青夕石赤千川先早草足村大男竹中虫町天田土二日入年白八百文木本名目立力林六引羽雲園遠何科夏家歌画回会海絵外角楽活間丸岩顔汽記帰弓牛魚京強教近兄形計元言原戸古午後語工公広交光考行高黄合谷国黒今才細作算止市矢姉思紙寺自時室社弱首秋週春書少場色食心新親図数西声星晴切雪船線前組走多太体台地池知茶昼長鳥朝直通弟店点電刀冬当東答頭同道読内南肉馬売買麦半番父風分聞米歩母方北毎妹万明鳴毛門夜野友用曜来里理話悪安暗医委意育員院飲運泳駅央横屋温化荷開界階寒感漢館岸起期客究急級宮球去橋業曲局銀区苦具君係軽血決研県庫湖向幸港号根祭皿仕死使始指歯詩次事持式実写者主守取酒受州拾終習集住重宿所暑助昭消商章勝乗植申身神真深進世整昔全相送想息速族他打対待代第題炭短談着注柱丁帳調追定庭笛鉄転都度投豆島湯登等動童農波配倍箱畑発反坂板皮悲美鼻筆氷表秒病品負部服福物平返勉放味命面問役薬由油有遊予羊洋葉陽様落流旅両緑礼列練路和愛案以衣位囲胃印英栄塩億加果貨課芽改械害街各覚完官管関観願希季紀喜旗器機議求泣救給挙漁共協鏡競極訓軍郡径型景芸欠結建健験固功好候航康告差菜最材昨札刷殺察参産散残士氏史司試児治辞失借種周祝順初松笑唱焼象照賞臣信成省清静席積折節説浅戦選然争倉巣束側続卒孫帯隊達単置仲貯兆腸低底停的典伝徒努灯堂働特得毒熱念敗梅博飯飛費必票標不夫付府副粉兵別辺変便包法望牧末満未脈民無約勇要養浴利陸良料量輪類令冷例歴連老労録圧移因永営衛易益液演応往桜恩可仮価河過賀快解格確額刊幹慣眼基寄規技義逆久旧居許境均禁句群経潔件券険検限現減故個護効厚耕鉱構興講混査再災妻採際在財罪雑酸賛支志枝師資飼示似識質舎謝授修述術準序招承証条状常情織職制性政勢精製税責績接 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main(int argc, char **argv) { | |
int matrix[50][50]; | |
int x, y; | |
for (x = 0; x < 50; x++) { | |
for (y = 0; y < 50; y++) { | |
matrix[x][y] = x + y; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#define X (50) | |
#define Y (50) | |
int main(int argc, char **argv) { | |
int **matrix = (int **)malloc(sizeof(int *) * X); | |
int x, y; | |
for (x = 0; x < X; x++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stddef.h> | |
typedef enum { | |
kJigokuTileFlagNone = 0, | |
kJigokuTileFlagCollision = 1, | |
kJigokuTileFlagItem = (1 << 1), | |
kJigokuTileFlagNPC = (1 << 2), | |
kJigokuTileFlagEnemy = (1 << 3), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# nkfはデフォルトで半角カナを全角カナにしてくれたり、未定義文字を良い感じにしてくれるので、String#encodeで変換できなかった文字はnkfに渡す。 | |
# -xを渡すと、半角全角変換はしない。 | |
str.encode('EUC-JP', Kconv.guess(str), fallback: -> char { NKF.nkf('-ex', char) }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
commands.addUserCommand( | |
['rcopy'], 'Copy for Regexp match string', | |
function(args, bang, count) { | |
var text = (function (e, re) { | |
var m = e.textContent.match(re); | |
if (m) return m[0]; | |
for (var i = 0; i < e.children.length; i++) { | |
var result = arguments.callee(e.children[i], re); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defvar anything-c-sources-local-gem-file | |
'((name . "gems (local)") | |
(candidates-in-buffer) | |
(init . (lambda () | |
(unless (anything-candidate-buffer) | |
(call-process-shell-command | |
"gem list" nil (anything-candidate-buffer 'global) | |
)))) | |
(action . (lambda (gem-name) | |
(setq gem-name (replace-regexp-in-string "\s+(.+)$" "" gem-name)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# dotfileのsymlinkつくるルール | |
rule /\/\..+?$/ => [proc {|task_name| | |
File.basename(task_name).sub(/^\./, '') | |
}] do |t| | |
if !File.exist?(t.name) and !File.symlink?(t.name) | |
ln_s t.source, t.name | |
end | |
end |