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
let fibo = parseInt(process.env.FIBO); | |
console.time(`Fib-${fibo}`); | |
let counter = 1; | |
var l = 0; | |
var r = 1; | |
const fib = () => { | |
const left = l; |
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
/** | |
* http://applemusic.tumblr.com/ | |
*/ | |
/** Ultra Light */ | |
@font-face { | |
font-family: "San Francisco"; | |
font-weight: 100; | |
src: url("https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-ultralight-webfont.woff"); | |
} |
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 waitFor = (ms) => new Promise(r => setTimeout(r, ms)) | |
const asyncForEach = (array, callback) => { | |
for (let index = 0; index < array.length; index++) { | |
await callback(array[index], index, array) | |
} | |
} | |
const start = async () => { | |
await asyncForEach([1, 2, 3], async (num) => { | |
await waitFor(50) |
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 anagram = (word1, word2) => { | |
const w1 = word1.toLowerCase().replace(/\s+|!/g, '').split(''); | |
const w2 = word2.toLowerCase().replace(/\s+|!/g, '').split('') | |
const letters1 = w1.reduce((prev, current, val) => { | |
if (typeof prev[current] !== 'undefined') { | |
return { ...prev, [current]: prev[current] + 1 } | |
} | |
return { ...prev, [current]: 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
export const CreateUserSearchQuery = (query) => { | |
let search1 = { $or: [] }; | |
let search2 = { $or: [] }; | |
let searchQuery = []; | |
if (!!query.text) { | |
search1['$or'].push({ 'profile.name': { $regex: query.text, $options: 'i' } }); | |
search1['$or'].push({ 'profile.surname': { $regex: query.text, $options: 'i' } }) | |
search1['$or'].push({ 'username': { $regex: query.text, $options: 'i' } }) | |
searchQuery.push(search1); | |
} |
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 obj = { | |
a: [], | |
b: { | |
c: [1], | |
q: 'asd', | |
d: { | |
h: 'asd', | |
g: 'sd', | |
e: { | |
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
### Keybase proof | |
I hereby claim: | |
* I am Ketcap on github. | |
* I am ketcap (https://keybase.io/ketcap) on keybase. | |
* I have a public key whose fingerprint is 321D 048A 0EE7 2D23 C88F 05B3 4773 9670 2817 91EE | |
To claim this, I am signing this object: |