Given a MP4 file...
Use MP4Box to extract into VOB/SUB format
First, find the info: /Volumes/GPAC\ for\ OSX/Osmo4.app/Contents/MacOS/MP4Box -info ~/Desktop/MOVIEFILE.m4v
* Movie Info *
Timescale 90000 - Duration 00:22:36.981
4 track(s)
| # set default pull target | |
| # http://stackoverflow.com/questions/658885/how-do-you-get-git-to-always-pull-from-a-specific-branch | |
| git config branch.master.remote origin | |
| git config branch.master.merge refs/heads/master |
Given a MP4 file...
Use MP4Box to extract into VOB/SUB format
First, find the info: /Volumes/GPAC\ for\ OSX/Osmo4.app/Contents/MacOS/MP4Box -info ~/Desktop/MOVIEFILE.m4v
* Movie Info *
Timescale 90000 - Duration 00:22:36.981
4 track(s)
| require 'rubygems' | |
| require 'twitter_oauth' | |
| require 'json' | |
| client = TwitterOAuth::Client.new( | |
| :consumer_key => 'THEKEY', | |
| :consumer_secret => 'THESECRET' | |
| ) | |
| request_token = client.authentication_request_token( :oauth_callback => 'oob') |
| #### spec/spec_helper.rb | |
| RSpec.configure do |config| | |
| # Use color in STDOUT | |
| config.color_enabled = true | |
| # Use color not only in STDOUT but also in pagers and files | |
| config.tty = true | |
| # Use the specified formatter |
| # Rails Engine call | |
| `rails plugin new MY_ENGINE --dummy-path=spec/dummy --skip-test-unit --full --database=mysql` | |
| or `rails plugin new ENGINE_NAME --dummy-path=spec/dummy --skip-test-unit --mountable --database=mysql` | |
| # Configure spec_helper.rb | |
| ENV["RAILS_ENV"] = "test" | |
| require File.expand_path("../dummy/config/environment.rb", __FILE__) | |
| require 'rspec/rails' |
| # http://viget.com/extend/rails-engine-testing-with-rspec-capybara-and-factorygirl | |
| rails plugin new my_engine --dummy-path=spec/dummy --skip-test-unit --mountable | |
| # or, the full monty: | |
| rails plugin new active_scraper --mountable --dummy-path=spec/dummy --skip-test-unit --skip-javascript --skip-sprockets --skip-action-view | |
| # https://github.com/rspec/rspec-rails | |
| rails generate rspec:install |
| require 'json' | |
| feed_owner_id = feed_array.first['id'].split('_')[0] | |
| vals = feed_array.map do |post| | |
| next if post.nil? || post.empty? | |
| hsh = {} | |
| if !post['from'] | |
| hsh[:from] = 'N/A' | |
| elsif post['from']['id'] != feed_owner_id |
| class String | |
| def astrip | |
| self.gsub(/([\302|\240|\s|\n|\t])|(\ ?){1,}/, ' ').gsub("\240",' ').ostrip | |
| end | |
| def clean_chars | |
| self.clean_dashes.clean_funny_spaces | |
| end | |
| # Not great, but better than doing everything by hand... | |
| def prepare_erb_for_slim(body) | |
| # remove all %> | |
| body.gsub!(/%> */, '') | |
| # convert <%-/= to - | |
| body.gsub!(/<%(-|=) */, '\1 ') |