Skip to content

Instantly share code, notes, and snippets.

View charliecm's full-sized avatar

Charlie Chao charliecm

View GitHub Profile
@charliecm
charliecm / image-to-video.bash
Created February 8, 2016 17:53
Sample snippet for converting a sequence of JPG images into a video (good for timelapse).
ffmpeg -r 25 -start_number 0 -i 'frame_%05d.jpg' -c:v libx264 -vf 'fps=25,format=yuv420p' out.mp4
@charliecm
charliecm / gh-pages.sh
Created November 17, 2016 17:10
Publish a subfolder to GitHub Pages; from https://gist.github.com/cobyism/4730490
git subtree push --prefix dist origin gh-pages
@charliecm
charliecm / .eslintrc
Created February 11, 2017 19:07
My personal JS coding style.
{
"env": {
"browser": true
},
"extends": "eslint:recommended",
"rules": {
"indent": [
"error",
"tab"
],
@charliecm
charliecm / git-zip.sh
Created March 24, 2017 21:51
Export git repo as zip for sharing or submitting an assignment.
# http://gitready.com/intermediate/2009/01/29/exporting-your-repository.html
git archive HEAD --format=zip > archive.zip
@charliecm
charliecm / copy-gps.sh
Created October 15, 2017 16:37
Copies GPS info from one image to another using exiftool.
#!/usr/bin/env bash
# arg 1 = source, arg 2 = destination
lon=$(exiftool -s3 -GPSLongitude "$1")
lat=$(exiftool -s3 -GPSLatitude "$1")
alt=$(exiftool -s3 -GPSAltitude "$1")
exiftool -GPSLongitude="$lon" -GPSLatitude="$lat" -GPSAltitude="$alt" "${@:2}"
@charliecm
charliecm / bookmarklets.md
Last active December 7, 2019 22:34
Useful bookmarklets for adding items to your accounts.

Useful Bookmarklets

Browser extensions tend to inject CSS/JS into every webpage your visit. A cleaner approach is to use bookmarklets. Simply add the snippets below as bookmarks and access them from your bookmark/address bar.

Pocket

Bookmarklet / Bookmarklet with Login Fix

javascript:window.open('https://getpocket.com/edit?url='+document.location,'PocketAdd','height=360,width=600')
@charliecm
charliecm / main.css
Created August 13, 2021 04:33
Obsidian custom CSS snippets.
/* ROOT -------------------------------------------------------------------- */
:root {
--default-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Microsoft YaHei Light", sans-serif;
}
h1, h2, h3, h4, h5, h6 {
font-weight: 700;
}