function economy() {
// Context (ignore)
// global.requirements // aggregated needs (demand vector)
// global.tools // current solutions (supply space)
// global.alignment_tools // governance/regulation/culture nudges
// affordably_exists() search provider, cost of installing product/service
// estimate_create_time() calculate engineering cost of product/service
// create() product or service
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
/** | |
* Raw name to simpler name (for markdown file) | |
*/ | |
function nameToHypenName(name) { | |
name = name | |
.replaceAll(",", "-") | |
.replaceAll(" ", "-") | |
.replaceAll("--", "-") | |
.replaceAll(":", "") | |
.replaceAll("(", "") |
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
## Get englisgh transcripts of a tree of .mp4 files | |
## Cost incurred: 200 videos of ~3 minutes each => around ~$5 | |
## Other params: ~200 API calls; total ~40,000 seconds | |
## Cost estimate as per pricing chart: 683 min * 0.006 = ~4.098 | |
## Ignores non mp4 files | |
## Adds .mp3 files for each file, and then calls Whisper API and stores the .txt | |
## Nothing is deleted | |
## Resumable |
I had some videos (actually a folder that one more level of folders and finally video files).
I wanted to generate .xspf
files for the whole folder, where each subfolder became a playlist. i.e I wanted to generate multiple files (one corresponding to each folder)
XSPF files are used by VLC to store a string of videos. You can open the file with VLC and it will play them as a playlist, allowing prev/next video.
tree.js
is used for generating the tree structure of the root folder, as an object.
gnome-terminal --working-directory some_path
Note:
- this option works only if used before other options, so keep it before.
- It doesn't work with relative paths, i.e.
..
won't work. This could be solved - StackOverflow
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
/* Instructions | |
1. Setup print preferences: Press Ctrl + P on any website. Enable headers + footers, background graphics, and set margin to custom (set all to 0, except the top, set it to 0.5mm using the mouse) | |
2. Copy and paste this file into the console | |
*/ | |
// copied from https://github.com/liady/ChatGPT-pdf | |
class Elements { | |
constructor() { | |
this.init(); | |
} |
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 util = require("util"); | |
const promisifiedExec = util.promisify(require("child_process").exec); | |
async function runCommand(command) { | |
let retVal; | |
try { | |
const { stdout, stderr } = await promisifiedExec(command); | |
retVal = [stderr || null, stdout]; | |
} catch (e) { | |
retVal = [{ code: e.code, message: e.message }, e.stdout]; |
- Install
react-native-cli
globally, by runningnpm install -g react-native-cli
. - Clone the repo. Do
npm install
inside it. - Connect phone (real) to the computer - by enabling USB debgugging/Wirelsss debugging through the "Developer Options" ((may need to enable them first, by clicking "Build number" repeatedly)). Accept permissions.
- Make sure the phone connected by running
adb devices
in the terminal. A device should be added, in the success case. - Run
react-native start
, press "a" for Android. - "r" when the procees seems to have stopped. Keep pressing this if something gets stuck.
- The app should now be installed and running on the phone.
- Editing files should update the app now, automatically
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Record Audio</title> | |
<style> | |
#audio-list { | |
list-style: none; | |
} | |
</style> | |
</head> |
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
/* | |
Local server (assumes Node.js is installed) | |
Purpose - the console code sends data to this (local) server, so | |
the transcript files can be saved locally. | |
Add this file to a folder, then run the following command in the folder | |
`npm init -y && npm install express body-parser cors && node app.js` | |
*/ | |
const express = require("express"); |
NewerOlder