FridayHug.com http://fridayhug.com
The Smallest Rails App http://thesmallestrailsapp.com
%w(action_controller/railtie coderay).each &method(:require)| require "json" | |
| struct = { "a" => 1, "b" => 2, "c" => [1, 2, 3], "d" => [{ "e" => 3 }, nil, false, true, [], {}] } | |
| source = JSON.dump(struct) | |
| tokens = [] | |
| index = 0 | |
| until source.empty? | |
| tokens << |
| .git | |
| .gitignore | |
| /doc | |
| .yardoc | |
| coverage | |
| jsdoc | |
| /tmp | |
| /log | |
| Dockerfile | |
| Dockerfile.prod |
| require 'ansi' | |
| require 'sqlite3' | |
| require 'active_record' | |
| require 'elasticsearch/model' | |
| require 'paperclip' | |
| require "paperclip/railtie" | |
| Paperclip::Railtie.insert | |
| ActiveRecord::Base.logger = ActiveSupport::Logger.new(STDOUT) |
| var express = require('express'); | |
| var subtitlesUrl = 'http://your-local-ip:8000/subtitles.vtt'; | |
| var app = express(); | |
| app.use(function(req, res, next) { | |
| res.header('transferMode.dlna.org', 'Streaming'); | |
| res.header('contentFeatures.dlna.org', 'DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000') | |
| res.header('CaptionInfo.sec', subtitlesUrl); |
FridayHug.com http://fridayhug.com
The Smallest Rails App http://thesmallestrailsapp.com
%w(action_controller/railtie coderay).each &method(:require)| class MyGroupedListController < UIViewController | |
| attr_accessor :posts | |
| attr_accessor :sections | |
| class TableViewSection | |
| attr_accessor :title | |
| attr_accessor :items | |
| def initialize(params={}) | |
| @title = params[:title] |
| #!/bin/sh | |
| # Output file for HTML5 video | |
| # requirements: ffmpeg .6+ | |
| # usage: ./html5video.sh infile.mp4 640x360 | |
| target_directory='converted' | |
| file=`basename $1` | |
| filename=${file%.*} | |
| filepath=`dirname $1` |
| class ActionDispatch::Routing::Mapper | |
| def draw(routes_name) | |
| instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb"))) | |
| end | |
| end | |
| BCX::Application.routes.draw do | |
| draw :api | |
| draw :account | |
| draw :session |
| class ActionDispatch::Routing::Mapper | |
| def draw(routes_name) | |
| instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb"))) | |
| end | |
| end | |
| BCX::Application.routes.draw do | |
| draw :api | |
| draw :account | |
| draw :session |
| # | |
| # Paperclip convert id => id_partition | |
| # | |
| require 'ftools' #FileUtils | |
| class PaperclipExtend | |
| def self.obtain_class | |
| class_name = ENV['CLASS'] || ENV['class'] | |
| uploads_path = ENV['UPLOADS_PATH'] || ENV['uploads_path'] | |
| raise "Must specify CLASS" unless class_name |