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
/**** | |
Adds h1,h2...h6 before the heading in live preview (editor) mode | |
Works well in typewriter theme as it does not change heading height in live preview mode, may work for other themes as well | |
****/ | |
.HyperMD-header.cm-line { | |
position: relative; | |
} |
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
// Name: Site Counter rvi.fyi | |
// Author: rvisharma | |
// Description: Get latest site visits for rvi.fyi | |
// Twitter: @life_of_rvi | |
import '@johnlindquist/kit' | |
let { entries, write } = await db({ entries: [] }) | |
onTab('Visits', async () => { |
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
// Menu: Decode JWT | |
// Description: Enter any string which contains valid jwt. | |
// Author: Ravi Sharma | |
// Twitter: @irvisharma | |
/** @type typeof import("jsonwebtoken") */ | |
const jwt = await npm('jsonwebtoken'); | |
try { | |
const dirtyEncodedToken = await arg('Paste token here', generateLiveHint); |
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
// an example to create a new mapping `ctrl-y` | |
mapkey('<Ctrl-y>', 'Show me the money', function() { | |
Front.showPopup('a well-known phrase uttered by characters in the 1996 film Jerry Maguire (Escape to close).'); | |
}); | |
// disable emojis | |
iunmap(":"); | |
// an example to replace `T` with `gt`, click `Default mappings` to see how `T` works. | |
map('gt', '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
console.clear(); | |
function createSafeObserver(unsafeObserver) { | |
let isDone = false; | |
const safeObserver = { | |
next: v => { | |
if (isDone) return; | |
unsafeObserver.next(v); |
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 parseLogs() { | |
// Write your code here. | |
return logs | |
// filter logs by method as POST and route as /create | |
.filter(eachLog => eachLog.includes('POST') && eachLog.includes('/create')) | |
// split the log and get the stringified object by index | |
.map(eachLog => eachLog.split('::')[3]) | |
// parse them to object | |
.map(eachLog => JSON.parse(eachLog)) | |
// filter by orders of Donuts (reduntant if filtering done along with Method filtering 'POST') |
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
{ | |
"Thin Strokes" : 4, | |
"Working Directory" : "\/Users\/ravi", | |
"Prompt Before Closing 2" : 0, | |
"Selected Text Color" : { | |
"Red Component" : 0, | |
"Color Space" : "sRGB", | |
"Blue Component" : 0, | |
"Alpha Component" : 1, | |
"Green Component" : 0 |
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 cloneScriptsRepo() { | |
// this function pulls the git repo (Scripts repo) | |
// return a promise and resolve it when git pull is completed | |
} | |
function getAllImages() { | |
// this function traverses the git repo (yaml files in /docker) | |
// parses all *.yaml files and returns list of docker images | |
} |
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
describe('generator functions', function(){ | |
it('should yield first 3 values using generator', () => { | |
// As part of this test, create a generator function `take` which | |
// accepts the count and an array, and yields values from | |
// array till the count reaches. | |
const iterator = take(3, ['A','B','C','D','E']); | |
// Do not modify any assertions | |
assert.equal(iterator.next().value, 'A') |
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
{"lastUpload":"2019-10-05T10:15:41.992Z","extensionVersion":"v3.2.9"} |
NewerOlder