Skip to content

Instantly share code, notes, and snippets.

Avatar
🙌
🙌

Loisaida Sam loisaidasam

🙌
🙌
View GitHub Profile
@loisaidasam
loisaidasam / picblast.sh
Last active Aug 2, 2019 — forked from bwhitman/picblast.sh
Make an audio collage out of your live photos
View picblast.sh
#!/bin/bash
mkdir /tmp/picblast
cd ~/Pictures/Photos\ Library.photoslibrary
for i in $(find . | grep jpegvideocompl)
do
ffmpeg -i $i /tmp/picblast/${i:(-8)}.wav
done
View postgres_queries_and_commands.sql
-- show running queries (9.2+)
SELECT pid, age(clock_timestamp(), query_start), usename, state, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start asc;
-- or if your query is very long/verbose
SELECT pid, age(clock_timestamp(), query_start), usename, state, substring(query, 1, 100)
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
View solution.py
Question: Convert following into the latter data structure in less than 30 lines:
List:
A, B, C
A, C, E
E, F, D
D, A, J
E, D, J
List