Skip to content

Instantly share code, notes, and snippets.

View bkono's full-sized avatar

Bryan Konowitz bkono

View GitHub Profile
@dhh
dhh / linux-setup.sh
Last active May 27, 2024 13:54
linux-setup.sh
# Libraries and infrastructure
sudo apt update -y
sudo apt install -y \
docker.io docker-buildx \
build-essential pkg-config autoconf bison rustc cargo clang \
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \
libvips imagemagick libmagickwand-dev mupdf mupdf-tools \
redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev \
rbenv apache2-utils
import {assertString} from 'plugins/assert'
type TemplateContext = {
input: string
customPrompt?: string
}
type Template = (context: TemplateContext) => string
type ServerPredictionPrompt = {
@DaniruKun
DaniruKun / whisper-transcribe.bash
Last active March 31, 2024 01:50
Transcribe (and translate) any VOD (e.g. from Youtube) using Whisper from OpenAI and embed subtitles!
#!/usr/bin/env bash
# Small shell script to more easily automatically download and transcribe live stream VODs.
# This uses YT-DLP, ffmpeg and the CPP version of Whisper: https://github.com/ggerganov/whisper.cpp
# Use `./transcribe-vod help` to print help info.
# MIT License
# Copyright (c) 2022 Daniils Petrovs
@Belphemur
Belphemur / 10-nextdns-catchall.sh
Created March 11, 2021 14:55
NextDNS catch all UDM
#!/bin/sh
SERVICE_FILE=nextdns-catchall.service
SOURCE_FILE_PATH=/data/${SERVICE_FILE}
SYSTEMD_FILE_PATH=/etc/systemd/system/${SERVICE_FILE}
if [ ! -f $SOURCE_FILE_PATH ];
then
echo "Can't find service file"
exit 1
fi
@amattn
amattn / deploy.sh
Last active September 9, 2023 05:41
#!/bin/sh
set -o nounset
set -o errexit
usage(){
echo "Usage: $0 X.Y.Z dev|test|staging|prod"
echo ""
echo "example: ./deploy.sh 1.1.3 prod"
echo "example: ./deploy.sh 1.2.0 dev"
@ttscoff
ttscoff / geticonpng.bash
Created September 12, 2020 11:37
Grab a PNG of any local Mac app icon
#!/bin/bash
# get any app's full-size icon, PNG version
function geticonpng() {
# Autocompletes app names with modified .app_completions scripts
APP=`echo $1|sed -e 's/\.app$//'`
APPDIR=''
for dir in "/Applications/" "/Applications/Setapp/" "/Applications/Utilities/" "/Users/ttscoff/Applications/" "/Developer/Applications/" "/Developer/Applications/Utilties/" "/System/Applications/"; do
if [[ -d "${dir}$APP.app" ]]; then
APPDIR="$dir"
import React, { useState, useEffect, createContext, useContext, ReactNode } from 'react'
import Amplify, { Auth, Hub } from 'aws-amplify'
import { CognitoUser } from '@aws-amplify/auth'
import { CognitoUserSession } from 'amazon-cognito-identity-js'
import { HubCallback } from '@aws-amplify/core/lib/Hub'
import IUser from '../../types/IUser'
interface IAuthContext {
user: IUser | null
login(username: string, password: string): Promise<CognitoUser>
@kamui545
kamui545 / dock.sh
Created October 24, 2019 03:37
Customize macOS dock via command line
#!/usr/bin/env bash
source "./dock_functions.sh"
declare -a apps=(
'/System/Applications/Utilities/Terminal.app'
'/System/Applications/Music.app'
'/Applications/Google Chrome.app'
'/Applications/PhpStorm.app'
'/Applications/Visual Studio Code.app'
@windlessuser
windlessuser / awsecsdeploy-stack.ts
Last active November 20, 2022 18:06
Deploys Mastodon using AWS CDK
import cdk = require('@aws-cdk/cdk');
import ec2 = require('@aws-cdk/aws-ec2');
import elastic = require('@aws-cdk/aws-elasticache');
import rds = require ('@aws-cdk/aws-rds');
import es = require("@aws-cdk/aws-elasticsearch");
import ecs = require('@aws-cdk/aws-ecs');
import s3 = require("@aws-cdk/aws-s3");
import elbv2 = require('@aws-cdk/aws-elasticloadbalancingv2');
import route53 = require('@aws-cdk/aws-route53');
import certificateManager = require("@aws-cdk/aws-certificatemanager");