Optional - Set format on save and any global prettier options
npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
| echo 'void async function() { const p = await Bun.file("package.json").json(); const out1 = Object.entries(p.dependencies).filter(([k,v]) => v === "latest").map(([k]) => k).reduce((acc, curr) => acc + " " +curr, "bun add"); const out2 = Object.entries(p.devDependencies).filter(([k,v]) => v === "latest").map(([k]) => k).reduce((acc, curr) => acc + " " +curr, "bun add -d"); console.log(`\n${out1}\n\n${out2}\n`) }()' > temp.js && bun run temp.js; rm temp.js |
| #!/usr/bin/env python3 | |
| import argparse | |
| import glob | |
| import os | |
| import struct | |
| import sys | |
| from sentencepiece import SentencePieceProcessor | |
| HPARAMS = keys = ["vocab_size", "dim", "multiple_of", "n_heads", "n_layers"] |
| import com.facebook.react.ReactApplication ; | |
| import com.facebook.react.bridge.ReactApplicationContext; | |
| import com.facebook.react.ReactPackage; | |
| import com.facebook.react.TurboReactPackage; | |
| import com.facebook.react.bridge.NativeModule; | |
| import com.facebook.react.module.model.ReactModuleInfo; | |
| import com.facebook.react.module.model.ReactModuleInfoProvider; | |
| import com.facebook.react.shell.MainReactPackage; | |
| // Tracking cursor position in real-time without JavaScript | |
| // Demo: https://twitter.com/davywtf/status/1124146339259002881 | |
| package main | |
| import ( | |
| "fmt" | |
| "net/http" | |
| "strings" | |
| ) |
| #!/usr/bin/env node | |
| // replace all UTC dates to local dates in pipe | |
| // usage: docker logs -t container_name | docker-logs-localtime | |
| // install: | |
| // curl https://gist.githubusercontent.com/popstas/ffcf282492fd78389d1df2ab7f31052a/raw/505cdf97c6a1edbb10c3b2b64e1836e0627b87a0/docker-logs-localtime > /usr/local/bin/docker-logs-localtime && chmod +x /usr/local/bin/docker-logs-localtime | |
| // alternative: https://github.com/HuangYingNing/docker-logs-localtime | |
| const pad = d => (d > 9 ? d : '0' + d); |
| // This sample is a Work in Progress for JSI , and specific functions may change. | |
| #pragma once | |
| #include <string> | |
| #include <unordered_map> | |
| #include <jsi/jsi.h> | |
| // This SameplJSIObject needs to inheric from HostObject, and this is the object that will be exposed to JS. |
| ########## Install NGINX ############## | |
| # Install software-properties-common package to give us add-apt-repository package | |
| sudo apt-get install -y software-properties-common | |
| # Install latest nginx version from community maintained ppa | |
| sudo add-apt-repository ppa:nginx/stable | |
| # Update packages after adding ppa |
| const CDP = require('chrome-remote-interface'); | |
| const argv = require('minimist')(process.argv.slice(2)); | |
| const file = require('fs'); | |
| // CLI Args | |
| const url = argv.url || 'https://www.google.com'; | |
| const format = argv.format === 'jpeg' ? 'jpeg' : 'png'; | |
| const viewportWidth = argv.viewportWidth || 1440; | |
| const viewportHeight = argv.viewportHeight || 900; | |
| const delay = argv.delay || 0; |