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
const user: { | |
firstName: string; | |
lastName: string; | |
age: number; | |
favoriteFoods: string[]; | |
hasPE: boolean; | |
} = { | |
firstName: "太郎", | |
lastName: "佐藤", | |
age: 24, |
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
// interface は拡張できる | |
// type は拡張できない | |
type MyType = { | |
readonly num?: number; | |
str: string; | |
nums: number[]; | |
status: "許可" | "不許可"; | |
tup: [string, number, string]; | |
}; |
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
var f=(x,r=0.2,m=~~(x/r))=>r*m+r-Math.sqrt(r*r-(r*m-x)**2);export default f; |
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
protocol Foo { | |
func bar(_ int: Int) | |
func bar(_ str: String) | |
} | |
struct Impl: Foo { | |
func bar<T>(_ value: T) { | |
print("hoge", value) | |
} | |
} |
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
use proconio::input; | |
use proconio::marker::Chars; | |
fn main() { | |
input! { | |
str: Chars | |
} | |
for index in 1..26 { | |
println!( |
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
45 9 * * 1-5 ps ax -o command | sed -ne 's/.*\/Applications\/\([^/]*\)\.app\/.*/\1/p' | sort -u | grep zoom | wc -l | xargs -I{} sh -c 'if [ "{}" == "0" ]; then afplay /Users/workspace/resources/Japanese_School_Bell02-02.mp3; fi' | |
0 17 * * 1-5 ps ax -o command | sed -ne 's/.*\/Applications\/\([^/]*\)\.app\/.*/\1/p' | sort -u | grep zoom | wc -l | xargs -I{} sh -c 'if [ "{}" == "0" ]; then afplay /Users/workspace/resources/VSQPD_018_yuyakekoyake_piano.mp3; fi' | |
19 18 * * 1-5 ps ax -o command | sed -ne 's/.*\/Applications\/\([^/]*\)\.app\/.*/\1/p' | sort -u | grep zoom | wc -l | xargs -I{} sh -c 'if [ "{}" == "0" ]; then afplay /Users/workspace/resources/Japanese_School_Bell02-02.mp3; fi' |
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 toDate(str) { | |
const arr = (str.substr(0, 4) + '/' + str.substr(4, 2) + '/' + str.substr(6, 2)).split('/'); | |
return new Date(arr[0], arr[1] - 1, arr[2], 0, 0, 0, 0); | |
} | |
function toString(date) { | |
const year = date.getFullYear(); | |
const month = ('0' + (date.getMonth() + 1)).slice(-2); | |
const day = ('0' + date.getDate()).slice(-2); | |
return `${year}` + month + day; |
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
const Octokit = require('@octokit/rest') | |
const octokit = new Octokit() | |
// Compare: https://developer.github.com/v3/repos/#list-organization-repositories | |
// octokit.repos.listForOrg({ | |
// org: 'octokit', | |
// type: 'public' | |
// }).then(({ data, status, headers }) => { | |
// // handle data | |
// console.log(data); |
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
{ | |
init: function(elevators, floors) { | |
var defaultPosition = [0, 0, 0, 0, 0] | |
// idle時に待ちが無ければ所定の位置へ、待ちがあればその階へ移動する | |
elevators.forEach(function(elevator, index, array) { | |
elevator.on("idle", function() { | |
elevator.goingUpIndicator(true); | |
elevator.goingDownIndicator(true); | |
elevator.goToFloor(defaultPosition[index]); |
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
{ | |
init: function(elevators, floors) { | |
var defaultPosition = [0, 2, 4, 6, 8] | |
var waitingList = [] | |
console.log("start!") | |
// idle時に待ちが無ければ所定の位置へ、待ちがあればその階へ移動する | |
elevators.forEach(function(elevator, index, array) { | |
elevator.on("idle", function() { |
NewerOlder