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
#!/bin/bash | |
# TODO: skip tiny files (so small they couldn't be photos) | |
# TODO: make sure sym links and other file system oddities are handled | |
# TODO: look at paralellization for perf boost | |
# | |
# Constants | |
# | |
CHAR_COUNT=12 | |
BLOCK_COUNT=6 |
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
// docs: | |
// https://docs.elevenlabs.io/api-reference/quick-start/introduction | |
// https://api.elevenlabs.io/docs#/text-to-speech/Text_to_speech_v1_text_to_speech__voice_id__post | |
const axios = require('axios'); | |
const fs = require('fs'); | |
const path = require('path'); | |
require('dotenv').config(); | |
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: Screenshot URL | |
import "@johnlindquist/kit" | |
const { chromium }: typeof import("playwright") = await npm( | |
"playwright" | |
) | |
// get URL from user | |
let urlFromUser = await arg("Enter the URL to screenshot"); |
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: today-timestamp | |
// Description: inserts today's date in "ISO" format 2023-02-11 | |
// Snippet: | |
import '@johnlindquist/kit'; | |
function twoDigits(number: number): string { | |
return number.toString().padStart(2, '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
import "@johnlindquist/kit" | |
// Menu: Giphy | |
// Description: Search giphy. Paste link. | |
// Author: John Lindquist | |
// Twitter: @johnlindquist | |
let download = await npm("image-downloader") | |
let queryString = await npm("query-string") |
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(){ | |
'use strict'; | |
/* | |
Create intra-page links | |
Requires that your headings already have an `id` attribute set (because that's what jekyll does) | |
For every heading in your page, this adds a little anchor link `#` that you can click to get a permalink to the heading. | |
Ignores `h1`, because you should only have one per page. | |
The text content of the tag is used to generate the link, so it will fail "gracefully-ish" if you have duplicate heading text. | |
*/ |
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
const Octokit = require('@octokit/rest'); // https://octokit.github.io/rest.js/ | |
// Customize this stuff: | |
const auth = 'your-key-generated-in-github-ui'; // PRIVATE! | |
const owner = 'repo-owner'; | |
const repo = 'your-repo-name'; | |
// Constants | |
const userAgent = 'git commiter v1'; | |
const ref = 'heads/master'; |
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
@Injectable({providedIn: 'root'}) | |
export class ExternalUrlService implements CanActivate { | |
canActivate({ data }: ActivatedRouteSnapshot): boolean { | |
window.open(data.externalUrl, '_blank'); | |
return false; | |
} | |
} |
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
const { readdirSync, statSync, writeFileSync } = require('fs') | |
const { join } = require('path') | |
// ----------------------------------------- Config | |
const DIR = '/home/deploy/www'; | |
const TARGET = '/home/deploy/deployNginxConfig'; | |
const HEADER = ` | |
# Config generated by 'generate-nginx-config.js', do not hand-edit |
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
// For every website folder that contains a certain file, autogen an index.html landing page for it. | |
const { readdirSync, statSync, writeFileSync, existsSync, readFileSync } = require('fs'); | |
const { join } = require('path'); | |
// ----------------------------------------- Config | |
const DIR = '/home/deploy/www'; | |
const CONFIG_FILE = 'logo/info.txt'; |
NewerOlder