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
Hiking ████████████████░░░░ 82% 🏔 | |
Walking █████████████████░░░ 89% 🚶 | |
Cycling ██████████████░░░░░░ 78% 🚴 | |
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
Vim ██████████████████░░ 95% | |
JS █████████████████░░░ 90% | |
GraphQL ████████████████░░░░ 89% | |
MongoDB ████████████████░░░░ 89% | |
Rust ██░░░░░░░░░░░░░░░░░░ 5% | |
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
/** | |
* Description: Wait until cron jobs finish when node app received the SIGINT signal | |
* scripts: "dev": "DEBUG=Goblin:* pm2 start --kill_timeout 300000 app.js" | |
* Author: Munkh-Orgil | |
* Date: 22/05/2020 | |
*/ | |
const express = require('express') | |
const events = require('events'); | |
const http = require('http') | |
const debug = require('debug'); |
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 obj = { | |
toString() { | |
return "[1,2,3]"; | |
} | |
}; | |
console.log(JSON.parse(obj)); | |
// (3) [1, 2, 3] |
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
/** | |
* React Native - Handling multiple TextInputs | |
* --------------- | |
* [1] [2] [3] [4] | |
* --------------- | |
* Author: Munkh-Orgil | |
* Date: 01/21/2020 | |
*/ | |
import React from 'react'; | |
import { View, TextInput } from 'react-native'; |
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
// Remove all databases, except local, admin | |
// on command line: mongo filename.js | |
const dbs = db.getMongo().getDBNames() | |
for(var i in dbs){ | |
db = db.getMongo().getDB( dbs[i] ); | |
if (db.getName() !== 'admin' && db.getName() !== 'local') | |
{ | |
print( "dropping db " + db.getName() ); | |
db.dropDatabase(); |
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
/* | |
* Compose curried function | |
*/ | |
const sum = a => b => a + b; | |
sum(5)(15); // 20 |
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
data:text/html;charset=utf-8,<title>In browser editor</title><style>body{background:lightgray;black:white;padding: 100px;font-family:JMH Typewriter, serif;font-size:2rem}</style><body contenteditable onkeypress="myFunction()"><audio id="audio" src="https://www.soundjay.com/communication/sounds/typewriter-line-break-1.mp3" ></audio> | |
Typwriter <script>function myFunction() {var audio = document.getElementById("audio");audio.play();}</script></body> |
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
(function() { | |
connection = new Mongo(); | |
db = connection.getDB('your_database'); | |
// any mongo command with client | |
db.dropDatabase(); | |
})(); |
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
/** | |
* Compose async functions | |
* @param {Functions} fns | |
* @returns {Promise} fns value | |
*/ | |
const compose = (...fns) => arg => fns.reduceRight((p, f) => p.then(f), Promise.resolve(arg)); | |
const foo = a => a + 1; | |
const bar = b => b + 1; |
NewerOlder