For Political Pride 2015. Reads a Trello board and formats for reading as a list. Fairly hacky due to the way I've handled day headings.
Needs a Markdown processor adding.
A Pen by Dr Kim Foale on CodePen.
| require 'rubygems' | |
| require 'RMagick' | |
| require 'csv' | |
| include Magick | |
| $imagepath = 'images/' | |
| cardlist = '../wordlist.csv' | |
| # Function to create all the cards | |
| def create_card(caption) |
For Political Pride 2015. Reads a Trello board and formats for reading as a list. Fairly hacky due to the way I've handled day headings.
Needs a Markdown processor adding.
A Pen by Dr Kim Foale on CodePen.
| source 'https://rubygems.org' | |
| # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
| gem 'rails' | |
| # Use SCSS for stylesheets | |
| gem 'sass-rails', '~> 5.0' | |
| # Use Uglifier as compressor for JavaScript assets | |
| gem 'uglifier', '>= 1.3.0' | |
| # Use CoffeeScript for .coffee assets and views | |
| gem 'coffee-rails', '~> 4.1.0' |
| Dir.glob('/YOUR_VIDEOS/*.mp4') do |f| | |
| name = File.basename(f, ".*") | |
| len = `ffprobe #{f} -show_entries format=duration -v quiet -of csv="p=0"` | |
| for n in (1..10) | |
| l = len.to_f / 10 * n | |
| `ffmpeg -i #{f} -ss #{l} -v quiet -vframes 1 './preview/#{name}_#{n}.png'` | |
| end | |
| end |
| /** | |
| * Documentation: http://docs.azk.io/Azkfile.js | |
| */ | |
| // Adds the systems that shape your system | |
| systems({ | |
| 'taichi-school': { | |
| // Dependent systems | |
| depends: ["postgres"], | |
| // More images: http://images.azk.io | |
| image: {"docker": "azukiapp/ruby:2.3.0"}, |
| Started PATCH "/shop/checkout/update/address" for 127.0.0.1 at 2016-10-19 11:02:58 +0100 | |
| Processing by Spree::CheckoutController#update as HTML | |
| Parameters: {"utf8"=>"✓", "authenticity_token"=>"Wr4CSN3bs2Ft8GeveWat+eKqjkcjR7pOsDZKYtJWncHShITVJjHV+gWaE3pNGzz94nceB/sX0B45MNKcrUvQ7g==", "order"=>{"email"=>"[email protected]", "state_lock_version"=>"2", "bill_address_attributes"=>{"firstname"=>"Kim", "lastname"=>"Foale", "address1"=>"5 Ribston St", "address2"=>"", "city"=>"Manchester", "country_id"=>"77", "zipcode"=>"M15 5RH", "phone"=>"3423423423432", "id"=>"44"}, "use_billing"=>"1", "ship_address_attributes"=>{"id"=>"45"}}, "commit"=>"Save and Continue", "save_user_address"=>"1", "state"=>"address"} | |
| User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 136]] | |
| Spree::Store Load (0.3ms) SELECT "spree_stores".* FROM "spree_stores" ORDER BY "spree_stores"."id" ASC LIMIT 1 | |
| Spree::Order Load (0.2ms) SELECT "spree_orders".* FROM "spree_orders" WHERE "spree_orders"."comple |
| # A couple of helper functions | |
| # This one converts country strings to Spree::Country objects. | |
| def convert_countries(countries) | |
| log = "" | |
| output = [] | |
| countries.each do |country| | |
| spree_country = Spree::Country.find_by(name: country) | |
| if spree_country.nil? | |
| spree_country = Spree::Country.find_by("name like ?", "%#{country}%") |
| # Creating a Digital Ocean droplet running Rails + Postgres with persistant storage and https | |
| #-------------------------------------------------------------------------------------------- | |
| # For your ctrl-D pleasure... | |
| # SERVER_IP | |
| # APP_NAME | |
| # RAILS_SECRET (generate with `rails secret`) | |
| # ADMIN_EMAIL | |