Skip to content

Instantly share code, notes, and snippets.

View mikhailbot's full-sized avatar
🐺

Mikhail mikhailbot

🐺
View GitHub Profile
@seanwash
seanwash / playbook--pull-request-review.md
Last active March 12, 2023 15:11
Playbook / Pull Request Review

Playbook / Pull Request Review

In the general case, look at every line of code that you have been assigned to review. source

Often times the version control software will only show the changed lines. But it's important to read the lines before and after, or the whole file, to ensure you understand exactly what the change is doing. source

Notes

  • Don't try to rush a PR review if you’re busy or rushing. This is how details are missed and context is glossed over.
@marcoarment
marcoarment / S3.php
Last active June 18, 2024 14:15
A simple PHP class to perform basic operations against Amazon S3 and compatible services.
<?php
/*
A simple PHP class to perform basic operations against Amazon S3 and compatible
services. Requires modern PHP (7+, probably) with curl, dom, and iconv modules.
Copyright 2022 Marco Arment. Released under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@mcrumm
mcrumm / phx_sqlite_fly_launch.md
Last active May 3, 2024 09:38
Phoenix + SQLite Deployment tips

Deploying to Fly.io with SQLite

Deploying a Phoenix app to Fly.io is a breeze...is what everyone kept telling me. In fairness, I imagine the process would have been breezier had I just used postgres, but all the sqlite and litestream talk has been far too intriguing to ignore. "Wait", you say. "It is just a flat file. How much harder can it be?"

It is easy to make something harder than it should be. It is hard to take something complex and make it truly simple. flyctl launch does an amazing job at providing a simple interface to the utterly complex task of generating deployment resources, especially now that we are living in a containerd (erm, firecracker) world.

This gist is for anyone who, like me, thinks they know better than to read all of the documentation and therefore necessari

@picatz
picatz / monitoring.hcl
Created December 12, 2020 19:43
A simple Nomad job file to deploy Prometheus and Grafana
job "metrics" {
datacenters = ["dc1"]
group "prometheus" {
network {
mode = "bridge"
}
service {
name = "prometheus"
@jackmcdade
jackmcdade / nginx.conf
Created January 10, 2020 19:38
Sample Statamic 2 Nginx Conf
server {
listen 80;
server_name example.com;
root /var/www/example.com/public/;
ssl_protocols TLSv1.2;
index index.html index.htm index.php;
charset utf-8;
@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution
Last active July 24, 2024 17:10
Fix DNS resolution in WSL2
More recent resolution:
1. cd ~/../../etc (go to etc folder in WSL).
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line).
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line).
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian).
5. cd ~/../../etc (go to etc folder in WSL).
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file).
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and
secondary.
@braun-steven
braun-steven / lily58-keyboard.org
Created August 12, 2019 22:52
Lily58 Pro Parts List
@jackmcdade
jackmcdade / globals.yaml
Created July 3, 2019 16:33
Statamic Fieldset for Head and Footer Scripts
title: 'Site Settings'
hide: true
sections:
main:
fields:
head_scripts:
mode: table
fields:
description:
type: text
@ttscoff
ttscoff / sizes.rb
Last active July 12, 2021 03:33
sizes: Calculate and sort all filesizes for current folder
#!/usr/bin/env ruby
# Sizes - Calculate and sort all filesizes for current folder Includes
# directory sizes, colorized output Brett Terpstra 2019 WTF License
VERSION = "1.0.1"
require 'shellwords'
# Just including term-ansicolor by @flori and avoiding all the
# rigamarole of requiring multiple files when it's not a gem... - Brett
#
@NickCraver
NickCraver / Overview.json
Created March 12, 2019 01:47
Craver's UniFi dashboard layout
{"name":"Overview","desc":"System Overview","controller_version":"5.10.12","modules":[{"id":"default:mega|status","module_id":"mega|status","restrictions":{"removable":false,"draggable":false},"config":{}},{"module_id":"summary|wifi","config":{},"id":"13a78652-ad84-4fcb-943a-86929c638353"},{"module_id":"clients|freq-distribution","config":{"palette":"BLUE_GRADIENT_10"},"id":"c9626f4f-021f-4d46-b22d-86007570bac7"},{"module_id":"clients|top5|active","config":{"trafficType":"total"},"id":"36a9e071-132e-4b4a-baee-250449a6d44f"},{"module_id":"devices|uap|top5|channel-util","config":{"trafficType":"total"},"id":"9803f077-b9cd-4db0-b466-60d92fae2020"},{"module_id":"devices|uap|top5|active","config":{"trafficType":"total"},"id":"e6133049-cc56-44b3-a4c2-b0843912dac5"},{"module_id":"devices|uap|top5|client-count","config":{},"id":"d39f9c80-1827-4ba0-b573-3209789c56b5"},{"module_id":"summary|switching","config":{},"id":"5966437b-54f7-43e6-9c03-2adbdeb3c0a6"},{"module_id":"devices|usw|top5|active","config":{},"id":"c83ac