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
| .sway { | |
| display: inline-block; | |
| animation-duration: 2s; | |
| animation-name: sway; | |
| animation-iteration-count: infinite; | |
| animation-direction: alternate; | |
| animation-timing-function: ease-in-out; | |
| } | |
| @keyframes sway { | |
| from { |
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
| // localStorageProxy.foo = 'bar' | |
| // -> localStorage.getItem('foo') = 'bar' | |
| localStorageProxy = new Proxy(localStorage, { | |
| get: (r,n)=>r.getItem(n), | |
| set: (r,n,v)=>r.setItem(n,v), | |
| deleteProperty: (r,n)=>r.removeItem(name) | |
| }) |
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
| // reverses the vowels of a (lowercase) word | |
| ( | |
| s=>(r=/[aeiou]/g,x=s.match(r),c=x.length,s.replace(r,_=>x[--c])) | |
| )('geographically') // -> gaigraphocelly |
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
| // sorts the vowels in a (lowercase) word | |
| ( | |
| s=>(r=/[aeiou]/g,x=s.match(r).sort(),c=0,s.replace(r,_=>x[c++])) | |
| )('crocodile') // -> crecidolo |
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 child_process = require('child_process') | |
| const readline = require('readline'); | |
| let bootRP = true; | |
| const rl = readline.createInterface({ | |
| input: process.stdin, | |
| output: process.stdout | |
| }); |
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
| #!/usr/bin/env -S /usr/local/bin/deno run | |
| import bitbar from 'https://esm.sh/bitbar'; | |
| bitbar([ | |
| {text: `Yo!`} | |
| ]) |
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
| import {read,writeFile,mkdir} from 'react-native-fs'; | |
| var Buffer = require('buffer/').Buffer; | |
| import pickle from 'chromium-pickle-js'; | |
| // read an asar and return its header data | |
| // expects to take a valid asar path | |
| // returns an object with the file structure, header size and asar path (for later reference) | |
| const readAsarHeader = async archive => { | |
| let size; | |
| let headerBuf; |
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
| #!/usr/bin/env /usr/local/bin/node | |
| const bitbar = require('bitbar'); | |
| const http = require('https'); | |
| const fetch = require('node-fetch') | |
| var emojiFlags = require('emoji-flags'); | |
| // change me for your country | |
| const region = 'UK' | |
| http.get(`https://disease.sh/v3/covid-19/countries/${region}`, async (res) => { |
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 getIndex = (array,index) => array[(array.length+index)%array.length] |
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 reorder = (array, index, moveBy) => { | |
| let temp = array.map((c,i)=>([c,i])) | |
| temp[index][1]=temp[index][1]+moveBy+(moveBy>0?.5:-.5) | |
| return temp.sort((a,b)=>a[1]-b[1]).map(c=>c[0]) | |
| } |