Skip to content

Instantly share code, notes, and snippets.

View paganotoni's full-sized avatar
💭
⚡️⚡️

Antonio Pagano paganotoni

💭
⚡️⚡️
View GitHub Profile
@paganotoni
paganotoni / cloudrun.md
Last active August 23, 2019 23:09
Configuring GCloud for CloudRun

Installling gcloud CLI tool.

For mac with brew

brew cask install google-cloud-sdk

For the rest of cases

Go to this page https://cloud.google.com/sdk/install and follow instructions.

Installing the beta components

gcloud components install beta

version: 2
jobs:
test:
docker:
- image: gobuffalo/buffalo:v0.12.3
working_directory: /go/src/github.com/our/app
steps:
- checkout
- run: |
q := tx.PaginateFromParams(c.Params())
c.Set("pagination", q.Paginator)
@paganotoni
paganotoni / usage.html
Created July 14, 2018 15:56
page indicator usage
<%= partial("partials/page-indicator.html", {plural: "Cats", basePath: catsPath({humanSlug: currentHuman.Slug})}) %>
@paganotoni
paganotoni / _page-indicator.html
Last active December 2, 2019 14:48
Page indicator
<div class="pagination-label">
<span class="opacity">Displaying <%= pagination.Offset + 1 %> - <%= pagination.Offset + pagination.CurrentEntriesSize %> of <%= pagination.TotalEntriesSize %> <%= plural %></span>
<i class="per-page-separator">|</i>
<span class="per-page-<%= paginator.perPage %>">
<a href="<%= basePath %>?per_page=25"><i class="opacity per-page-25-number per-page-option">25</i></a>
<a href="<%= basePath %>?per_page=50"><i class="opacity per-page-50-number per-page-option">50</i></a>
<a href="<%= basePath %>?per_page=100"><i class="opacity per-page-100-number per-page-option"> 100</i></a>
<i class="opacity"><%= plural %> per page.</i>
</span>
</div>
@paganotoni
paganotoni / webpack.config.js
Created April 5, 2018 20:51
stanislas-webpack
const webpack = require("webpack");
const glob = require("glob");
const path = require("path");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const ManifestPlugin = require("webpack-assets-manifest");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
const CleanWebpackPlugin = require("clean-webpack-plugin");
var MODE = process.env.NODE_ENV || "development";

Keybase proof

I hereby claim:

  • I am paganotoni on github.
  • I am apaganobeleno (https://keybase.io/apaganobeleno) on keybase.
  • I have a public key whose fingerprint is 5130 DAED 965B 1B69 E25D 3BD8 7EC2 EB8E 12F7 B9E3

To claim this, I am signing this object:

@paganotoni
paganotoni / release.sh
Last active March 23, 2017 17:07
Release script from commits.
#!/bin/sh
git log $(git describe --tags $(git rev-list --tags --max-count=1))...HEAD --pretty=format:'* %s ' --reverse | grep -v Merge | cat - CHANGELOG.md > temp && mv temp CHANGELOG.md
echo "\n**** Version $1" | cat - CHANGELOG.md > temp && mv temp CHANGELOG.md
git tag -a $1 -m "Version $1 released"
echo "$1" > version
@paganotoni
paganotoni / rubyinit.zsh
Created July 24, 2015 16:57
Ruby project initialization script.
# Initialization for a ruby project
PROJECTS_DIR="/Users/$(whoami)/Projects"
rubyinit(){
PROJECT_NAME="$1"
PROJECT_FOLDER="$2"
if [ -z "$PROJECT_NAME" ]; then
echo "| ERROR You must specify a project name!"
return
@paganotoni
paganotoni / install.sh
Last active August 29, 2015 14:21 — forked from wdullaer/install.sh
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Add Docker PPA and install latest version
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
sudo apt-get update
sudo apt-get install lxc-docker -y