Skip to content

Instantly share code, notes, and snippets.

View lukehedger's full-sized avatar
🍵
(ू˃̣̣̣̣̣̣︿˂̣̣̣̣̣̣ ू)

Luke Hedger lukehedger

🍵
(ू˃̣̣̣̣̣̣︿˂̣̣̣̣̣̣ ू)
View GitHub Profile
@lukehedger
lukehedger / ffmpeg-trim
Created February 16, 2015 14:48
Trim video using FFMPEG
$ ffmpeg -i movie.mp4 -ss 00:00:05 -t 00:01:00 -async 1 cut.mp4
# -ss = start time
# -t = duration, not end time
@lukehedger
lukehedger / gc.js
Last active August 29, 2015 14:17
Monitor JS garbage collection
// run this in Chrome with the --enable-precise-memory-info flag
// $ open -a "Google Chrome" --args --enable-precise-memory-info
timer = function() {
requestAnimationFrame(timer)
var heapBefore = window.performance.memory.usedJSHeapSize
// run processes here
// eg. console.log allocates 2216 bytes, new Object() 56 bytes
@lukehedger
lukehedger / ffmpeg-compress-mp4
Last active May 8, 2025 01:06
Compress mp4 using FFMPEG
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4
@lukehedger
lukehedger / law-permissions.sh
Created August 27, 2015 14:42
Nail permissions on Law
$ ll
$ sudo chown -R hub_bot:www-data .
$ sudo chmod -R 755 .
@lukehedger
lukehedger / git-alias.sh
Last active January 7, 2016 12:32
Git cmd aliases
# open global git config
$ atom ~/.gitconfig
[alias]
today = !git log --since=midnight --author=\"$(git config user.name)\" --oneline
yday = !git log --since=day.before.yesterday.midnight --until=midnight --author=\"$(git config user.name)\" --oneline
co = !git checkout
pu = !git push -u
ci = !git commit -am
$ du -h -d 1 ./
@lukehedger
lukehedger / view-kill-process.sh
Created February 29, 2016 11:16
View and kill processes
# view all processes
ps -ax
# filter processes
ps -ax | grep <process-name>
# kill process
kill <process-PID>
@lukehedger
lukehedger / zsh-alias.sh
Created February 29, 2016 12:39
ZSH aliases
# list aliases
alias
# add alias
alias name='command'
# remove alias
unalias name
@lukehedger
lukehedger / es6-class.js
Created March 9, 2016 17:53
Just playing around with ES6 Classes
class Klass {
constructor() {
console.log('hello class!')
}
static util(a, b) {
return a + b
}
render() {