workflow:
$ rails g model NameOfModel
invoke active_record
create db/migrate/YYYYMMDDHHMMSS_create_name_of_models.rb
var fs = require('fs'); | |
fs.readFile('subtitle.srt', function(error, data) { | |
if(error) | |
throw error; | |
var text = data.toString(); | |
var lines = text.split('\n'); | |
var output = []; |
t = 236 # seconds | |
Time.at(t).utc.strftime("%H:%M:%S") | |
=> "00:03:56" | |
# Reference | |
# http://stackoverflow.com/questions/3963930/ruby-rails-how-to-convert-seconds-to-time |
# Nginx can serve FLV/MP4 files by pseudo-streaming way without any specific media-server software. | |
# To do the custom build we use 2 modules: --with-http_secure_link_module --with-http_flv_module | |
# This module "secure-link" helps you to protect links from stealing away. | |
# | |
# NOTE: see more details at coderwall: http://coderwall.com/p/3hksyg | |
cd /usr/src | |
wget http://nginx.org/download/nginx-1.5.13.tar.gz | |
tar xzvf ./nginx-1.5.13.tar.gz && rm -f ./nginx-1.5.13.tar.gz |
# (c) Thomas Fritzsche | |
# This is prove-of-concept coding only | |
# iOS devices insist on support for byte-rage http header, that is not native | |
# supported by rack apps like dragonfly | |
# this rack middleware will evaluate the http header and provide byte range support. | |
# For a dragonfly Rails (3.2.3) app I have tested this will call like this. | |
# I reload Rack::Cache that case trouble when initialized by Rails. | |
# This small trick makes it working :-) | |
#----------------------- |
- Arts: | |
- Design | |
- Fashion & Beauty | |
- Food | |
- Literature | |
- Performing Arts | |
- Spoken Word | |
- Visual Arts | |
- Business: | |
- Business News |