Skip to content

Instantly share code, notes, and snippets.

{
"auto_find_in_selection": true,
"auto_match_enabled": false,
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"detect_indentation": false,
"draw_indent_guides": true,
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"font_face": "Ricty Diminished",
"font_size": 28,
class Cell {
constructor(token, x, y) {
this.token = token;
this.x = x;
this.y = y;
}
}
class FillMap {
static emptyMap(width, height) {
@gooocho
gooocho / tower-defence.js
Last active July 7, 2017 12:48
とりあえず
var gameMap;
(function() {
'use strict';
const startTime = Date.now();
const MOVE = {
walk: 'WALK',
fly: 'FLY',
// referring:
// https://github.com/itbaby/brackets-expand-selection-to-quotes/blob/master/main.js
define(function(require,exports,module){
var AppInit = brackets.getModule('utils/AppInit'),
KeyBindingManager = brackets.getModule('command/KeyBindingManager'),
CommandManager = brackets.getModule('command/CommandManager'),
EditorManager = brackets.getModule('editor/EditorManager');
var EXPAND_SELECTION_TO_QUOTES = 'Expand selection to quotes',
CMD_SELECT_TO_QUOTES = 'quotes.select';
@gooocho
gooocho / espowerun.cmd
Created August 23, 2013 09:08
azu さんのespowerun.jsをキックするwindows用シェルスクリプト c.f. https://gist.github.com/azu/6309397
@echo off
if "%1"=="" (
echo "Usage: ./espowerun.cmd path/to/test.js"
exit
)
set tmpname=
set tmpdir=
FOR /L %%i IN (0 1 100) DO (
@gooocho
gooocho / sprintf.js
Last active December 19, 2015 16:38
underscore.stringのsprintf http://www.diveintojavascript.com/projects/javascript-sprintf も qiitaで紹介されてたsprintf http://homepage3.nifty.com/aya_js/js_sub/sprintf.js も仕様 http://linuxjm.sourceforge.jp/html/LDP_man-pages/man3/printf.3.html を全然満たしてないので自分で作った あとでもう少し直す/テスト書く
var sprintf = (function(isModerate) {
function lpad(str, len, ch) {
str = String(str);
len = ~~len;
ch = String(ch);
if (str.length > len) {
return str;
}
return ((new Array(len + 1).join(ch)) + str).slice(-len);
@gooocho
gooocho / .ctrl_exchange_en.nodoka
Last active November 24, 2016 22:57
nodokaの設定ファイルないと作業効率が半分くらいになる
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 窓使いの憂鬱 - dot.mayu
# Copyright (C) 1999-2005, TAGA Nayuta <nayuta@users.sourceforge.net>
#
include "109.nodoka"
include "104on109_edited.nodoka" # 109 keyboard 上で 104 keyboard 風に動かす
mod control += 英数 # 英数を Control に
key *英数 = *LControl # 〃
(function(w) {
var model = {
getDetail: function(callback) {
$.getJSON('./detail.json')
.done(function(data) {
callback(data);
});
}
};
var page = require('webpage').create();
page.onConsoleMessage = function(msg) {
console.log(msg);
};
page.open('http://localhost/test.html', function (status) {
// Check for page load success
if (status !== "success") {
console.log("Unable to access network");
} else {
// Execute some DOM inspection within the page context
■HTML風文字列
"<ul><li><ul><li></li><li>"
といった文字列.
"<"と">"が多いなー、という風に認識している程度で、どこまでが1番目のul要素なのかはまだわかりません.
■DOM Tree
HTML風文字列を
・省略された閉じタグの補完
・不正なHTMLの修正
・コメントの解釈