Skip to content

Instantly share code, notes, and snippets.

@pacarvalho
pacarvalho / Fastfile
Created November 29, 2022 01:12
Medium - Continuous Deployment React Native to Apple App Store - Fastfile
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
@pacarvalho
pacarvalho / layout.erb
Created July 18, 2022 02:21
Medium - Static Website with Middleman - layout.erb
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Use the title from a page's frontmatter if it has one -->
<title><%= current_page.data.title || "Middleman" %></title>
<%= stylesheet_link_tag "site" %>
@pacarvalho
pacarvalho / index.html.erb
Created July 18, 2022 02:16
Medium - Static Website with Middleman - index.html.erb
---
title: Welcome to Middleman
---
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 340" class="middleman-logo" aria-labelledby="middleman-logo__title" role="img">
<title id="middleman-logo__title">Middleman</title>
<path class="middleman-logo__top-left-bar" fill-opacity=".45" d="M0 40L200 0v30L0 60z"/>
<path class="middleman-logo__top-right-bar" fill="#fff" d="M200 0l200 40v20L200 30z"/>
<path class="middleman-logo__left-m" fill-opacity=".45" d="M0 78v184l45 5V152l45 83 47-83v129l53 7V52l-57 8-43 83-43-70z"/>
@pacarvalho
pacarvalho / Gemfile
Created July 18, 2022 01:17
Medium - Static Website with Middleman - Gemfile
source 'https://rubygems.org'
gem 'middleman', '~> 4.2'
gem 'middleman-autoprefixer', '~> 2.7'
gem 'middleman-livereload'
gem 'mini_racer', platforms: :ruby
gem "nokogiri"
gem 'tzinfo-data', platforms: [:mswin, :mingw, :jruby, :x64_mingw]
gem 'wdm', '~> 0.1', platforms: [:mswin, :mingw, :x64_mingw]
@pacarvalho
pacarvalho / config.rb
Created July 18, 2022 01:03
Medium - Static Website with Middleman - config.rb
# Activate and configure extensions
# https://middlemanapp.com/advanced/configuration/#configuring-extensions
activate :autoprefixer do |prefix|
prefix.browsers = "last 2 versions"
end
# Live reload during development
activate :livereload
@pacarvalho
pacarvalho / buildspec.yml
Created July 18, 2022 01:00
Medium - Static Website with Middleman - buildspec.yml
version: 0.2
phases:
install:
runtime-versions:
ruby: 3.1
commands:
- gem install middleman
pre_build:
commands:
- bundle install
@pacarvalho
pacarvalho / deploy.sh
Created June 12, 2022 18:48
Medium - Serverless Form - deploy.sh
#!/bin/bash
# exit when any command fails
set -e
script_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
sam deploy \
--template-file ${script_path}/../template.yaml \
--stack-name serverless-website-form-production \
@pacarvalho
pacarvalho / index.js
Created June 12, 2022 18:41
Medium - Serverless Form - index.js
const aws = require("aws-sdk"); // Library to interact with AWS resources
const ses = new aws.SES({ region: "us-east-1" });
exports.handler = async (eventObject, context, callback) => {
// Log event data to ease debugging
console.log(
"Received event:",
JSON.stringify(eventObject, context, callback)
);
@pacarvalho
pacarvalho / template.yaml
Created June 12, 2022 18:32
Medium - Serverless Form - template.yaml
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: >
serverless-form
SAM project for serverless-form
Parameters:
LambdaVersion:
Default: "not-specified"
@pacarvalho
pacarvalho / 123_create_video.rb
Created April 17, 2022 15:00
Medium Article - Custom Backend Video Model Migration
class CreateVideo < ActiveRecord::Migration[6.1]
def change
create_table :videos, id: :uuid do |t|
t.string :key, unique: true, index: true
t.string :low_res_key, unique: true, index: true
t.references :user, foreign_key: true, type: :uuid
t.timestamps
end
end
end