Skip to content

Instantly share code, notes, and snippets.

View tilsammans's full-sized avatar

Joost Baaij tilsammans

View GitHub Profile
@tilsammans
tilsammans / Dockerfile
Last active August 28, 2018 12:27
Source for our Rails CI containers. Repo at https://github.com/spacebabies/rails-ci
FROM ruby:2.5.1-slim
MAINTAINER Space Babies <[email protected]>
LABEL description="Continuous Integration of our Rails apps"
# Install dependencies:
# - libxml2, zlib1g-dev, liblzma-dev: nokogiri and friends
# - libpq-dev: needed to build `pg`
# - libmysqlclient-dev: needed to build `mysql2`
RUN apt-get update --quiet && apt-get install --no-install-recommends --quiet --yes \
@tilsammans
tilsammans / cookie_consent_opt_in.js
Created May 28, 2018 16:53
Activate inert HTML after a true Cookie Consent opt-in
@tilsammans
tilsammans / config.rb
Created August 7, 2017 16:31
Middleman Netlify HTTP/2 Server Push
ready do
# Insert fingerprinted asset paths into _headers for Netlify.
proxy "/_headers", "/headers.txt",
layout: false,
locals: {
# these variables will be different for you. Add at will!
all_css: sitemap.find_resource_by_path('css/all.css'),
vendor_js: sitemap.find_resource_by_path('js/vendor.js'),
main_js: sitemap.find_resource_by_path('js/main.js')
},
@tilsammans
tilsammans / NetlifyServerPushPlugin.js
Last active January 17, 2018 08:57 — forked from ValentinFunk/NetlifyServerPushPlugin.js
Webpack - Generate Netlify HTTP2 Server Push _headers File when using the HtmlWebpackPlugin
/**
* Generate a Netlify HTTP2 Server Push configuration.
*
* Options:
* - headersFile {string} path to the _headers file that should be generated (relative to your output dir)
*/
function NetlifyServerPushPlugin(options) {
this.options = options;
}
{
"input":"s3://media.scrollytelling.io/main/video_files/attachment_on_s3s/000/001/090/original/NIKLAAS_P._HOYNG9118.mp4",
"outputs":[
{
"label":"webm_high",
"format":"webm",
"size":"1280x720",
"quality":4,
"max_video_bitrate":3500,
"public":1,
@tilsammans
tilsammans / gist:1eab2bd101ad1486c3e0707722cce464
Last active March 8, 2017 08:10
zencoder failure from 4k input
{
"job": {
"created_at": "2017-03-06T10:17:05Z",
"finished_at": "2017-03-06T10:18:33Z",
"id": 353083574,
"pass_through": null,
"privacy": false,
"state": "failed",
"submitted_at": "2017-03-06T10:17:05Z",
"test": false,
Mysql2::Error: Table 'storyboard_production.pageflow_sites' doesn't exist
from active_record/connection_adapters/abstract_mysql_adapter.rb:303:in `query'
from active_record/connection_adapters/abstract_mysql_adapter.rb:303:in `block in execute'
from active_record/connection_adapters/abstract_adapter.rb:378:in `block in log'
from active_support/notifications/instrumenter.rb:20:in `instrument'
from active_record/connection_adapters/abstract_adapter.rb:372:in `log'
from active_record/connection_adapters/abstract_mysql_adapter.rb:303:in `execute'
from active_record/connection_adapters/mysql2_adapter.rb:228:in `execute'
from active_record/connection_adapters/abstract_mysql_adapter.rb:310:in `execute_and_free'
from active_record/connection_adapters/abstract_mysql_adapter.rb:451:in `columns'
["/Users/joost/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/activesupport-4.1.14.1/lib/active_support/locale/en.yml", "/Users/joost/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/activemodel-4.1.14.1/lib/active_model/locale/en.yml", "/Users/joost/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/activerecord-4.1.14.1/lib/active_record/locale/en.yml", "/Users/joost/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/actionview-4.1.14.1/lib/action_view/locale/en.yml", "/Users/joost/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/ransack-1.7.0/lib/ransack/locale/cs.yml", "/Users/joost/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/ransack-1.7.0/lib/ransack/locale/de.yml", "/Users/joost/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/ransack-1.7.0/lib/ransack/locale/en.yml", "/Users/joost/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/ransack-1.7.0/lib/ransack/locale/es.yml", "/Users/joost/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/ransack-1.7.0/lib/ransack/locale/fr.yml", "/Users/joost/.rbenv/versions/2.1.6/lib/ruby
echo "gem 'react-rails'" >> Gemfile
bundle
rails g react:install
var PostcodeCheck = React.createClass({
// all existing code again omitted
handleSubmit: function(e) {
e.preventDefault();
if (!this.state.postcode || !this.state.housenumber) {
this.setState({result: 'Postcode en huisnummer zijn verplichte velden.'});
return;