ffmpeg -i input.mp4 -b 1000000 output.mp4ffmpeg -i input.m2ts -vcodec libx264 -crf 20 -acodec ac3 -vf "yadif" output.mp4| RSpec.configure do |config| | |
| config.before(:suite) do | |
| ActiveRecord::Base.establish_connection database['one'] | |
| DatabaseCleaner.strategy = :deletion | |
| ActiveRecord::Base.establish_connection config.database['two'] | |
| DatabaseCleaner.strategy = :deletion | |
| end | |
| config.before(:each) do |
| git branch -m old_branch new_branch # Rename branch locally | |
| git push origin :old_branch # Delete the old branch | |
| git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
| var app = require('../server/app.js').create() | |
| var gulp = require('gulp'); | |
| var task = require('./index'); | |
| /* | |
| Output all the routes that the app supports | |
| */ | |
| gulp.task('routes', function() { |
| # By extending a regular ruby hash with this module the hash will behave as if | |
| # it were an immutable object. The brackets and fetch methods will return copies | |
| # of values and the assignment method will raise an exception. | |
| # | |
| # Other methods that should be redefined for a truly immutable hash object. | |
| # :delete, :delete_if, :reject!, :select!, :keep_if, :merge!, :update | |
| module ReadOnlyHash | |
| def [](key) | |
| value = super(key) | |
| value ? value.dup : default |
| #!/bin/sh | |
| export DEBIAN_FRONTEND=noninteractive | |
| sudo rm -rf /etc/apt/sources.list.d/mysql.list | |
| sudo add-apt-repository -y ppa:ondrej/mysql-5.5 | |
| sudo debconf-set-selections <<< "mysql-community-server mysql-community-server/remove-data-dir boolean true" | |
| sudo apt-get remove --purge -y mysql-client mysql-common mysql-community-client mysql-community-server mysql-server php5-mysql libmysqlclient-dev libmysqlclient18 | |
| sudo apt-get update | |
| DEBIAN_FRONTEND=noninteractive sudo -E bash -c 'apt-get -y --force-yes install mysql-server libmysqlclient-dev' | |
| mysqladmin -u root password semaphoredb |
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
| # Read initial standard input from the data segment at the end of the file | |
| # You can also see what is ultimately output down there | |
| pos = DATA.pos # => 1617 | |
| $stdin.reopen __FILE__ # => #<IO:/var/folders/7g/mbft22555w3_2nqs_h1kbglw0000gn/T/seeing_is_believing_temp_dir20161210-36802-czciw7/program.rb> | |
| $stdin.seek pos, :SET # => 0 | |
| # The commands that will be piped together | |
| commands = [ | |
| %w[cat], | |
| %w[tr a A], |
| ruby '2.7.1' | |
| gem 'rails', github: 'rails/rails' | |
| gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
| # Action Text | |
| gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
| gem 'okra', github: 'basecamp/okra' | |
| # Drivers |