Skip to content

Instantly share code, notes, and snippets.

View andrielfn's full-sized avatar
🏠
Working from home

Andriel Nuernberg andrielfn

🏠
Working from home
View GitHub Profile
@andrielfn
andrielfn / 1-setup.md
Created July 17, 2024 22:30 — forked from troyfontaine/1-setup.md
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@andrielfn
andrielfn / compare_bike_view.ex
Created April 13, 2019 14:20
Bike comparison with Phoenix Live View
defmodule GoBikesWeb.CompareSelectBikeView do
use Phoenix.LiveView
alias GoBikesWeb.Router.Helpers, as: Routes
alias GoBikes.Bikes
def render(assigns) do
GoBikesWeb.CompareView.render("show.html", assigns)
end
@andrielfn
andrielfn / nginx.conf
Created February 12, 2017 20:11
Best Nginx config for security.
# Best Nginx configuration for security.
#
# Score A in https://securityheaders.io.
# Score A+ in https://www.ssllabs.com/ssltest.
#
# References
#
# - https://letsecure.me/secure-web-deployment-with-lets-encrypt-and-nginx/
# - https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html
# - https://gist.github.com/plentz/6737338
@andrielfn
andrielfn / .scss-lint.yml
Last active January 24, 2017 00:44
The structure that I use to start new front-end projects. Download only the `frontend-init` and run it on your terminal. :)
# This is the lint file for .scss files. It uses https://github.com/causes/scss-lint
# to search through .scss files and point out errors.
# You can view these errors in your editor.
#
# Here's a link to all the default configurations
# https://github.com/causes/scss-lint/blob/master/config/default.yml
# below is our settings.
linters:
BangFormat:

Rails Performance

Upgrade the Ruby version

Use Apache Benchmark (ab) to perform tests over each Ruby version.

Database

There are two mainly ways to do that:

@andrielfn
andrielfn / settings.json
Created April 18, 2016 00:37
ST3 Afterglow theme config
{
"auto_complete": true,
"auto_complete_selector": "source - comment",
"auto_indent": true,
"bold_folder_labels": true,
"close_windows_when_empty": true,
"color_scheme": "Packages/Colorsublime - Themes/Afterglow.tmTheme",
"detect_indentation": true,
"draw_indent_guides": true,
"enable_tab_scrolling": false,
@andrielfn
andrielfn / settings.json
Created December 4, 2015 17:34
My Sublime Text 3 config file.
{
"auto_complete": true,
"auto_complete_selector": "source - comment",
"auto_indent": true,
"bold_folder_labels": true,
"close_windows_when_empty": true,
"color_scheme": "Packages/Theme - Cobalt2/cobalt2.tmTheme",
"detect_indentation": true,
"draw_indent_guides": true,
"enable_tab_scrolling": false,
@andrielfn
andrielfn / main.go
Created June 16, 2015 00:47
UDP socket in Go.
package main
import (
"fmt"
"net"
"os"
)
/* A Simple function to verify error */
func CheckError(err error) {
@andrielfn
andrielfn / populate.go
Created April 28, 2015 16:24
Script to populate MySQL databases up to the *size-limit*. OS X binary download: https://www.dropbox.com/s/2gecxhqkxa7wpmq/bombsql?dl=0.
package main
import (
"database/sql"
"fmt"
"log"
"os"
"strconv"
_ "github.com/go-sql-driver/mysql"
@andrielfn
andrielfn / ssh.go
Created November 15, 2014 04:35
Go lang SSH connection
package main
import (
"bytes"
"code.google.com/p/go.crypto/ssh"
"fmt"
"io/ioutil"
"os"
)