This file contains 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure("2") do |config| | |
# The most common configuration options are documented and commented below. | |
# For a complete reference, please see the online documentation at |
This file contains 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
/* | |
export interface GridArray<T> extends Array<T> { | |
first?(): T; | |
} | |
export interface Table<T> { | |
select(filter: object): GridArray<T>; | |
} | |
*/ |
This file contains 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
/* | |
export interface GridArray<T> extends Array<T> { | |
first?(): T; | |
} | |
export interface Table<T> { | |
select(filter: object): GridArray<T>; | |
} | |
*/ |
This file contains 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
const readline = require('readline') | |
const util = require('util') | |
const rl = readline.createInterface({input: process.stdin, output: process.stdout}) | |
rl.question[util.promisify.custom] = (arg) => { | |
return new Promise((resolve) => { | |
rl.question(arg, resolve); | |
}); | |
}; | |
const questionPromise = util.promisify(rl.question); | |
questionPromise('What do you think of Node.js? ').then((answer) => { |
This file contains 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
class Checker { | |
start() { | |
if (this.checked) { | |
this.stop(); | |
} | |
this.checked = new Promise((resolve, reject) => { | |
this.resolve = resolve; | |
this.reject = reject; | |
}); | |
} |
This file contains 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
var Item = Vue.extend({ | |
data: function () { | |
return { | |
id: 0, | |
message: '' | |
}; | |
}, | |
template: '<li :data-id="id">{{ message }}</li>' | |
}); |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
<script src="node_modules/vue/dist/vue.js"></script> | |
<script> | |
var vm; | |
document.addEventListener('DOMContentLoaded', () => { | |
vm = new Vue({ |
This file contains 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
<template> | |
<div> | |
<div class="card p-1" v-for="nippo in nippoes"> | |
<h3 class="card-title">{{ toJpDate(nippo.created_at) }}</h3> | |
<p class="card-text">{{ nippo.content }}</p> <router-link :to="{ name: 'edit', params: { id: nippo.id } }" class="btn btn-info">編集</router-link> | |
</div> | |
</div> | |
</template> | |
<script> |
This file contains 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
local function keyCode(key, modifiers) | |
modifiers = modifiers or {} | |
return function() | |
hs.eventtap.event.newKeyEvent(modifiers, string.lower(key), true):post() | |
hs.timer.usleep(1000) | |
hs.eventtap.event.newKeyEvent(modifiers, string.lower(key), false):post() | |
end | |
end | |
local function keyCodeSet(keys) |
This file contains 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
String.fromCodePoint(parseInt("1f376", 16)) | |
String.fromCodePoint(0x1F376) | |
// "🍶" | |
Array.from("🍶🍣") | |
// ["🍶", "🍣"] | |
"🍶".codePointAt(0).toString(16) | |
// "1f376" |
NewerOlder