Skip to content

Instantly share code, notes, and snippets.

View doniz's full-sized avatar

Donatas Navidonskis doniz

View GitHub Profile
@doniz
doniz / ffmpeg.md
Last active August 29, 2015 14:14 — forked from radavis/ffmpeg.md

Sample ffmpeg Commands

Convert to 480p

ffmpeg -i input.mp4 -s hd480 -c:v libx264 -crf 23 -c:a aac -strict -2 output.mp4

Convert to 720p via scaling, copy audio

ffmpeg -i input.mp4 \
    error_page 404 /assets/error-404.html;
    error_page 500 /assets/error-500.html;
    
    location / {
        try_files $uri @silverstripe;
    }
    
    location @silverstripe {
        fastcgi_keep_conn on;
<?php
/**
* Configure SilverStripe from the _ss_environment.php file.
*
* Edit this file and rename from _ss_environment.sample.php to _ss_environment.php.
* Put "require_once('conf/ConfigureFromEnv.php');" into your _config.php file.
* http://doc.silverstripe.org/framework/en/trunk/topics/environment-management
*/
  # update git submodules
  git submodule update --init --recursive
  # this updates the submodules pointers
  git submodule foreach --recursive git submodule sync
@doniz
doniz / count-php-file-lines.md
Last active October 1, 2015 19:44
count all lines of the php files
  # count all lines of php files
  find . -name '*.php' | xargs wc -l
  # Get current directory size via command shell line
  find . -type f -exec ls -l {} \; | awk '{sum += $5} END {print sum}'
@doniz
doniz / remove-modified-files-from-git.md
Last active November 25, 2015 21:39
remove modified files from git history
  git stash save --keep-index
@doniz
doniz / space-add.md
Created November 30, 2015 13:36
Add Space at Mac OS X Dock
  defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'
  killall Dock
@doniz
doniz / git-helper.md
Last active December 15, 2015 10:26
some git helper
  # add new tag
  git tag -a v1.2 9fceb02 -m "Message here"
  # delete tag localy
  git tag -d v1.2
  # delete tag from remote
  git push origin :refs/tags/v1.2
  # Or, more expressively, --delete option:
  git push --delete origin v1.2
@doniz
doniz / unzipper.sh
Created October 21, 2016 19:30
unzip multiple files into directories
# taken from http://stackoverflow.com/questions/11289551/argument-list-too-long-error-for-rm-cp-mv-commands#answer-11289567
for f in *.zip; do
# Creating a name for the new directory.
new_dir="${f##*/}"
new_dir="${new_dir%.*}"
# Creating the directory if it doesn't already exist.
mkdir -p "$new_dir"
# Unzip contents of "$f" to "$new_dir"
unzip -d "$new_dir" -- "$f"