- C-a == Ctrl-a
- M-a == Alt-a
:q close
:w write/saves
:wa[!] write/save all windows [force]
:wq write/save and close
CURRENT_BRANCH = `git status | head -1`.to_s.gsub('On branch ','').chomp |
If you have any sort of administrative interface on your web site, you can easily imagine an intruder gaining access and mucking about. How do you know the extent of the damage? Adding an audit log to your app is one quick solution. An audit log should record a few things:
Using the Rails framework, this is as simple as adding a before_action
to your admin controllers. Here’s a basic version that I’m using in production.
# 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.
#!/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 |
#!/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 | |
# |