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 Hoge (){ | |
| console.log("this at constructor: ", this); | |
| var _this = this; | |
| setTimeout(function(){ | |
| console.log('this at basic function', this); | |
| console.log('_this at basic function', _this); | |
| },1); | |
| setTimeout(()=>{ | |
| console.log('this at allow function', this); | |
| console.log('_this at allow function', _this); |
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 hogeAsync(callback){ | |
| setTimeout(function(){ | |
| callback(10); | |
| }, 10000); | |
| } | |
| var one = null; | |
| new Promise(function(resolve, reject){ | |
| hogeAsync(resolve); | |
| }).then(function(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
| fuga () { | |
| echo $0 | |
| } | |
| echo "current command: $0" | |
| echo "fuga: $(fuga)" |
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
| #!/bin/sh | |
| echo '{"private": true}' > package.json | |
| npm install -D vue vue-router typescript | |
| { | |
| echo 'import * as Vue from "./node_modules/vue/types/index";' | |
| echo 'import * as VueRouter from "./node_modules/vue-router/types/index";' | |
| } > index.ts | |
| $(npm bin)/tsc -t 'ES2015' index.ts |
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> | |
| int printArray(int *ip, int len); | |
| int main(int argc, char *args[]){ | |
| int arr[3] = {0, 1, 2}; | |
| int *ip = arr; | |
| printArray(arr, 3); | |
| printf("%d\n", *ip); | |
| *ip++; // [0, 1, 2] -> [1, 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
| " Information | |
| set number | |
| set showcmd | |
| set list | |
| " http://qiita.com/mfujimori/items/9fd41bcd8d1ce9170301 | |
| " Search | |
| set ignorecase | |
| set smartcase |
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
| enum ClothesType { | |
| OnePiece | |
| } | |
| interface ClothesInterface { | |
| type:ClothesType; | |
| color:Color; | |
| } | |
| class Clothes extends Item implements ClothesInterface { | |
| } |
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
| #!/bin/bash | |
| main(){ | |
| if ! isRequireCommandsInstalled; then | |
| return 1 | |
| fi | |
| subtasksBuild=() |
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
| #!/bin/bash | |
| src=$1 | |
| dest=$2 | |
| backup=$3 | |
| # backupのパスがファイルなら終了 | |
| if [ -f $backup ] ; then | |
| echo "\$backup is file" | |
| exit 1 |
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
| class Todo { | |
| storeName :string = "todo"; | |
| db :IDBDatabase; | |
| id :number = null; | |
| value :string = ""; | |
| serialize() :TodoSchema{ | |
| // ... | |
| } | |
| static deserialize(data){ | |
| // ... |