Skip to content

Instantly share code, notes, and snippets.

View kortina's full-sized avatar

kortina kortina

View GitHub Profile
@dannguyen
dannguyen / cardib-politics-talk-transcribe.md
Last active October 26, 2022 15:40
An example of how to use command-line tools to transcribe a viral video of Cardi B

Transcribing Cardi B's political speech with AWS Transcribe and command-line tools

Inspired by the following exchange on Twitter, in which someone captures and posts a valuable video onto Twitter, but doesn't have the resources to easily transcribe it for the hearing-impaired, I thought it'd be fun to try out Amazon's AWS Transcribe service to help with this problem, and to see if I could do it all from the bash command-line like a Unix dork.

Screencap of @jordanuhl's video tweet, followed by a request for a transcript

The instructions and code below show how to use command-line tools/scripting and Amazon's Transcribe service to transcribe the audio from online video. tl;dr: AWS Transcribe is a pretty amaz

@jeinarsson
jeinarsson / 00 ics icalendar import.md
Last active October 24, 2023 08:23
ICS icalendar event importer
@kortina
kortina / postgres_queries_and_commands.sql
Created February 22, 2017 05:35 — forked from indigoviolet/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@indigoviolet
indigoviolet / postgres_queries_and_commands.sql
Created November 15, 2016 00:26 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@ZevEisenberg
ZevEisenberg / keyboardShortcuts.sh
Last active January 2, 2020 12:22
Keyboard Shortcut Shell Script Magic
function addCustomMenuEntryIfNeeded
{
if [[ $# == 0 || $# > 1 ]]; then
echo "usage: addCustomMenuEntryIfNeeded com.company.appname"
return 1
else
local contents=`defaults read com.apple.universalaccess "com.apple.custommenu.apps"`
local grepResults=`echo $contents | grep $1`
if [[ -z $grepResults ]]; then
# does not contain app
@ningsuhen
ningsuhen / Regex.swift
Last active April 27, 2019 18:39
Swift extension for Native String class to support Regex match and Regex replace. Credit - http://www.swift-studies.com/blog/2014/6/12/regex-matching-and-template-replacement-operators-in-swift
import Foundation
struct Regex {
var pattern: String {
didSet {
updateRegex()
}
}
var expressionOptions: NSRegularExpressionOptions {
didSet {
@codeinthehole
codeinthehole / .gitconfig
Created August 14, 2014 11:06
Git aliases for quickly opening Github pages
[alias]
# Open the Github page for the...
# ...repo homepage (included for consistency)
open = !hub browse --
# ...repo commits
opencommits = !hub browse -- commits
# ...commit page for HEAD
@staltz
staltz / introrx.md
Last active July 22, 2024 09:31
The introduction to Reactive Programming you've been missing
@zacs
zacs / LebowskiPhrases.csv
Last active March 28, 2021 04:23
Text segmentation analysis of the Big Lebowski script, looking for multi-word phrase size and frequency.
Phrase Word Count Frequency
this is what happens when you fuck a stranger in the ass 12 2
he lives in north hollywood on radford near the in-and-out burger 11 2
it's a complicated case maude lotta ins lotta outs 9 2
so what the fuck are you talking about 8 2
what the fuck are you talking about 7 6
what the fuck is he talking about 7 2
we know that this is your homework 7 2
we throw the money out of the 7 2
you're out of your element this chinaman 7 2
@dlo
dlo / Auto-layout-keyboard-adjustment.md
Last active February 26, 2021 07:33
How to adjust a view's height with Auto Layout when a keyboard appears or disappears in iOS 7.

This gist outlines how to resize a view when a keyboard appears using Auto Layout (there are a bunch of code samples out there that manually adjust the view's frame, but that's just so 2013). The method I outline below works universally on both iPhone and iPad, portrait and landscape, and is pretty darn simple.

Setting Up

The first thing to do is to define our containing view controller, the view, and the bottom constraint that we'll use to adjust its size.

Here's HeightAdjustingViewController.h. We don't need to expose any public properties, so it's pretty bare.