Skip to content

Instantly share code, notes, and snippets.

View AlexanderMint's full-sized avatar
🏄‍♂️
Surfing

Alexander Mint AlexanderMint

🏄‍♂️
Surfing
View GitHub Profile
@AlexanderMint
AlexanderMint / Dockerfile
Created November 18, 2023 23:14
Compile and install any version via brew
ARG BREW_VERSION=latest
ARG GOOSE_VERSION='v3.16.0'
FROM homebrew/brew:${BREW_VERSION} AS brew
ENV HOMEBREW_NO_AUTO_UPDATE=1
RUN git config --global user.name "build"
RUN git config --global user.email "build@docker.com"
@AlexanderMint
AlexanderMint / private_fork.md
Created December 18, 2022 08:28 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@AlexanderMint
AlexanderMint / MultiSwap.sol
Created September 20, 2022 15:32 — forked from gorgos/MultiSwap.sol
Example for how to swap multiple tokens in one on Ropsten
// SPDX-License-Identifier: MIT
pragma solidity =0.7.6;
pragma abicoder v2;
import "https://github.com/Uniswap/uniswap-v3-periphery/blob/main/contracts/interfaces/ISwapRouter.sol";
import "https://github.com/Uniswap/uniswap-v3-periphery/blob/main/contracts/interfaces/IQuoter.sol";
import {IERC20, SafeERC20} from "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.4-solc-0.7/contracts/token/ERC20/SafeERC20.sol";
interface IUniswapRouter is ISwapRouter {
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'faraday'
require 'colorize'
require 'json'
require 'yaml'
class DomainChecker
LENGTH = 2..3
Example SendGrid mailer
brew install fd
brew install entr
fd | entr -r bin/hanami s
@AlexanderMint
AlexanderMint / DefaultController
Last active December 4, 2022 15:31
Ruby on Rails default controller + pundit
module DefaultController
extend ActiveSupport::Concern
included do
before_action :load_collection, only: [:index]
before_action :generate_model, only: [:new]
before_action :create_model, only: [:create]
before_action :load_model, only: %i[edit update show destroy]
before_action :alias_variable_model, only: %i[index new create show edit update destroy]
end
DROP SCHEMA public CASCADE;
CREATE SCHEMA public;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO public;
GRANT ALL ON SCHEMA public TO deployer;