Feel free to contact me at [email protected] or tweet at me @statisticsftw
This is a rough outline of how we utilize next.js and S3/Cloudfront. Hope it helps!
It assumes some knowledge of AWS.
#!/bin/bash | |
# Renames subtitles files according to tv shows names found in a directory | |
# Acceped syntaxes for season/episode are: 304, s3e04, s03e04, 3x04, Ep-04 (case insensitive) | |
# | |
# Installation: | |
# Put this gist somewhere in your $PATH, like /usr/local/bin/sub.sh | |
# Chmod +x it | |
# cd ~/YourTvShowsFolderContainingVideoAndSubtitleFiles | |
# sub |
# post_serializer.rb | |
class PostSerializer < ActiveModel::Serializer | |
has_many :comments | |
attributes :id, :title, :content | |
end | |
# comment_serializer.rb |
source "https://rubygems.org" | |
gem "roda" | |
gem "http", "~> 3.3" | |
gem "rest-client" | |
gem "httparty" |
Feel free to contact me at [email protected] or tweet at me @statisticsftw
This is a rough outline of how we utilize next.js and S3/Cloudfront. Hope it helps!
It assumes some knowledge of AWS.
// Save page as HTML and add JQuery for convenience | |
arr = [] | |
$('.item_well').each((index, element) => { | |
arr[index] = {} | |
let dyno = $(element).find('div.dyno_size option:selected').text() | |
let job = $(element).find('input.input--code')[0].value | |
# All variable names in a nice convenient file, each one in a separate line: | |
# heroku config --app <app> | awk '{print $1}' | sed s/:$//g >> env_variables.txt | |
# or | |
# cat .env | awk -F= '{print $1}' | sed '/^#/ d' | sed s/:$//g | sort >> env_variables.txt | |
variables=`cat env_variables.txt` | |
# new array | |
declare -a zombie_variables |
#!/bin/bash | |
# Copyright © 2017 Google Inc. | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software |
Dear people, as you may already know we transcend to the Rails5 era! Rails 5 required a Ruby upgrade so, apart from the new Rails APIs, we jumped from Ruby 2.3.8 to 2.6.3!
Apart from many performance improvements with less memory consumption, this gives us several goodies we can use from now on.
brew install libidn
rvm install ruby-2.6.3
sudo gem update --system 2.6.3
# Open an Rails console and paste these below. | |
# (exit and open another in case of edit) | |
noop = Proc.new {[200, {}, ["hello"]]} | |
request = Rack::MockRequest.new(noop) | |
Rails.configuration.middleware = Rails.configuration.middleware.dup | |
Benchmark.ips do |x| | |
x.config(time: 250, warmup: 5) |
#!/usr/bin/env bash | |
# Download this gist | |
# curl -Ls https://gist.github.com/ang3lkar/bc14f3a8abf1197c6889d5bea92511f1/raw/semversort.sh | bash | |
# And run: | |
# $ semversort 1.0 1.0-rc 1.0-patch 1.0-alpha | |
# or in GIT | |
# $ semversort $(git tag) | |
# Using pipeline: | |
# $ echo 1.0 1.0-rc 1.0-patch 1.0-alpha | semversort | |
# |