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
/** | |
* This delay function returns a Promise which will fullfill when the timer goes off | |
*/ | |
export default function delay(fn, duration) { | |
return new Promise(resolve => setTimeout(() => { fn(); resolve()}), duration) | |
} |
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
04c0c0e476bd9f08980c6451372e78fa3accea476a6206b2219c3fe67fdf1bebdf0c7827f93e7f864f7ef778f83f053bb08c790977cc632cb81e987f6121cfe7a5 |
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
registry=https://registry.npm.taobao.org | |
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/ | |
phantomjs_cdnurl=http://cdn.npm.taobao.org/dist/phantomjs | |
electron_mirror=http://cdn.npm.taobao.org/dist/electron/ |
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 url = 'ws://localhost:1234' | |
let ws = new WebSocket(url,'test_protocol') | |
ws.onopen = () => { | |
console.log('Client connection opened') | |
ws.send('Hello Websocket') | |
} | |
ws.onmessage = (event) => { | |
console.log('Received message : '+ event.data) | |
} |
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
public String triangleGenerator(int num, char letter ){ | |
if(num%2==0){ | |
num++ | |
} | |
// int num = 21; // input num (assume odd) | |
// char letter = 'A'; // input char | |
int rows = (num+1)/2; // the amount of rows | |
String result = ""; | |
int rowIdx = 1; // assume the idx of first row is 1 |
NewerOlder