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
/* -------------------------------------------------------------------------- */ | |
/* More here; */ | |
/* -------------------------------------------------------------------------- */ | |
// https://gist.github.com/rphlmr/0d1722a794ed5a16da0fdf6652902b15 | |
export function distinctOn<Column extends AnyColumn>(column: Column) { | |
return sql<Column["_"]["data"]>`distinct on (${column}) ${column}`; | |
} | |
export function jsonBuildObject<T extends SelectedFields>(shape: T) { |
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
// Credits to Louistiti from Drizzle Discord: https://discord.com/channels/1043890932593987624/1130802621750448160/1143083373535973406 | |
import { sql } from "drizzle-orm"; | |
const clearDb = async (): Promise<void> => { | |
const query = sql<string>`SELECT table_name | |
FROM information_schema.tables | |
WHERE table_schema = 'public' | |
AND table_type = 'BASE TABLE'; | |
`; |
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
// ==UserScript== | |
// @name Translate Amazon | |
// @namespace http://your.homepage/ | |
// @version 0.1 | |
// @description Translate the Amazon service names into plain English. See https://www.expeditedssl.com/aws-in-plain-english | |
// @author @ideasasylum | |
// @match https://*.console.aws.amazon.com/console/home?* | |
// @grant none | |
// ==/UserScript== |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.require_plugin "aws-sdk" | |
def get_box_download_url(bucket, key) | |
s3 = AWS::S3.new | |
bucket = s3.buckets[bucket] | |
box = bucket.objects[key] | |
url = box.url_for(:read, {:expires => (60*30), :secure => true}) | |
url.to_s() |
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
HandBrakeCLI --input tears_of_steel_720p.mkv --output 5000.mp4 --encoder x264 -b 5000 --srt-file TOS-en.srt --x264-preset ultrafast | |
HandBrakeCLI --input tears_of_steel_720p.mkv --output 500.mp4 --encoder x264 -b 500 --srt-file TOS-en.srt --x264-preset ultrafast | |
HandBrakeCLI --input tears_of_steel_720p.mkv --output 50.mp4 --encoder x264 -b 50 --srt-file TOS-en.srt --x264-preset ultrafast | |
HandBrakeCLI --input tears_of_steel_720p.mkv --output 5.mp4 --encoder x264 -b 5 --srt-file TOS-en.srt --x264-preset ultrafast | |
mkdir 5000Kbps | |
mediafilesegmenter -t 10 -f 5000Kbps/ -I 5000.mp4 | |
mkdir 500Kbps | |
mediafilesegmenter -t 10 -f 500Kbps/ -I 500.mp4 | |
mkdir 50Kbps |
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
{ | |
"bold_folder_labels": true, | |
"detect_slow_plugins": false, | |
"caret_style": "phase", | |
"ensure_newline_at_eof_on_save": true, | |
"file_exclude_patterns": | |
[ | |
".DS_Store", | |
".gitkeep", | |
"dump.rdb" |