Skip to content

Instantly share code, notes, and snippets.

@tilsammans
tilsammans / Dockerfile
Last active Aug 28, 2018
Source for our Rails CI containers. Repo at https://github.com/spacebabies/rails-ci
View Dockerfile
FROM ruby:2.5.1-slim
MAINTAINER Space Babies <info@spacebabies.nl>
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
Activate inert HTML after a true Cookie Consent opt-in
View cookie_consent_opt_in.js
@tilsammans
tilsammans / config.rb
Created Aug 7, 2017
Middleman Netlify HTTP/2 Server Push
View config.rb
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 Jan 17, 2018 — forked from Kamshak/NetlifyServerPushPlugin.js
Webpack - Generate Netlify HTTP2 Server Push _headers File when using the HtmlWebpackPlugin
View NetlifyServerPushPlugin.js
/**
* 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;
}
View builder.json
{
"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,
View gist:1eab2bd101ad1486c3e0707722cce464
{
"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,
View gist:570dce18f696af0887f2210c4bad6755
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'
View I18n.load_path
["/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
View commands.sh
echo "gem 'react-rails'" >> Gemfile
bundle
rails g react:install
View postcode.js.jsx
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;