This file contains hidden or 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
| $ du -h -d 1 ./ |
This file contains hidden or 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
| # 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 |
This file contains hidden or 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
| $ ll | |
| $ sudo chown -R hub_bot:www-data . | |
| $ sudo chmod -R 755 . |
This file contains hidden or 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
| $ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4 |
This file contains hidden or 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
| // 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 |
This file contains hidden or 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
| $ ffmpeg -i movie.mp4 -ss 00:00:05 -t 00:01:00 -async 1 cut.mp4 | |
| # -ss = start time | |
| # -t = duration, not end time |
This file contains hidden or 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
| ffmpeg -i file.mp4 -r 60 $filename%03d.jpg |
This file contains hidden or 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
| # get a log of today's commits | |
| $ git config --global alias.today '!git log --since=midnight --author="$(git config user.name)" --oneline' | |
| $ git today | |
| # get a log of yesterday's commits | |
| $ git config --global alias.yday '!git log --graph --since=day.before.yesterday.midnight --until=midnight --author="$(git config user.name)" --oneline' | |
| $ git yday |
This file contains hidden or 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
| nano ~/.bash_profile | |
| # or subl ~/.bash_profile | |
| # add the following to your bash_profile and any other commands you use regularly | |
| # command aliases | |
| # git | |
| alias gs='git status' | |
| alias gpom='git push origin master' | |
| # cd |
This file contains hidden or 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
| $ brew install rbenv ruby-build | |
| $ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile | |
| # restart terminal | |
| $ type rbenv | |
| #=> "rbenv is a function" | |
| $ rbenv install --list | |
| #=> list of all available installations | |
| $ rbenv install 2.1.3 | |
| #=> install specified version | |
| $ rbenv global 2.1.3 |