Skip to content

Instantly share code, notes, and snippets.

@asgerb
asgerb / index.js
Created June 11, 2021 11:50
netlify-cache-bridgetown-media-transformation
module.exports = {
// Restore file/directory cached in previous builds.
// Does not do anything if:
// - the file/directory already exists locally
// - the file/directory has not been cached yet
async onPreBuild({ utils }) {
await utils.cache.restore("./.bmt-cache")
},
// Cache file/directory for future builds.
// Does not do anything if:
@asgerb
asgerb / production.rb
Created July 25, 2014 12:33
production.rb
# ---------------------------------------------------------------------
set :rails_env, "production"
set :deploy_to, "/home/#{fetch(:user)}/public_html/#{fetch(:application)}"
set :branch, "master"
@asgerb
asgerb / deploy.rb
Created July 25, 2014 12:32
deploy.rb
# config valid only for Capistrano 3.1
lock '3.2.1'
# ---------------------------------------------------------------------
server 'server', roles: %w{web app db}
set :application, 'app_name'
set :user, 'deployer'
@asgerb
asgerb / Capfile
Created July 25, 2014 12:23
Capfile
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/chruby'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/puma'
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
@asgerb
asgerb / Gemfile
Last active August 29, 2015 14:04
Gemfile
source 'https://rubygems.org'
source 'https://rails-assets.org'
# ---------------------------------------------------------------------
gem 'rails', '4.1.0'
# ---------------------------------------------------------------------
gem 'puma', '~> 2.9.0'
@asgerb
asgerb / 0_reuse_code.js
Created October 4, 2013 22:28
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console