When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:
main {
max-width: 38rem;
padding: 2rem;
margin: auto;
}| package main | |
| import ( | |
| "crypto" | |
| "crypto/rand" | |
| "crypto/rsa" | |
| "crypto/sha256" | |
| "encoding/base64" | |
| "fmt" | |
| ) |
| package main | |
| import ( | |
| "log" | |
| // replace right path | |
| "[...]/utils" | |
| "go.uber.org/zap" | |
| "go.uber.org/zap/zapcore" | |
| ) |
| if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) { | |
| // path/to/whatever does not exist | |
| } | |
| if _, err := os.Stat("/path/to/whatever"); !os.IsNotExist(err) { | |
| // path/to/whatever exists | |
| } |
| /***** "Remote" server first *****/ | |
| -- Note: Unless the object you are trying to gain access to is in the same DATABASE, it's a remote datebase. Even if it's | |
| -- on the same node! | |
| -- 1. create the role and assign it a password. Note: CREATE USER is an alias for CREATE ROLE. Either one is fine | |
| CREATE ROLE new_user WITH PASSWORD 'somepassword'; | |
| -- 2. Grant the required permissions. This grants select, insert, update, and delete on all tables in the public schema. | |
| -- I also gave execute to all functions in the public schema as well. | |
| GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO new_user; | |
| GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public TO new_user; |
| if ( ! function_exists("slugify")) { | |
| function slugify($text) | |
| { | |
| // replace non letter or digits by - | |
| $text = preg_replace('~[^\pL\d]+~u', '-', $text); | |
| // transliterate | |
| $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text); | |
| // remove unwanted characters |
| if ( ! function_exists("mime2ext")) { | |
| function mime2ext($mime) | |
| { | |
| $all_mimes = [ | |
| 'png' => [0 => 'image/png', 1 => 'image/x-png'], | |
| 'bmp' => [ | |
| 0 => 'image/bmp', | |
| 1 => 'image/x-bmp', | |
| 2 => 'image/x-bitmap', | |
| 3 => 'image/x-xbitmap', |
| #!/bin/sh | |
| # default commands for osx to make it nicer to work with | |
| ########################## | |
| # General UI?UX settings # | |
| ########################## | |
| # Set hostname (hex of MVB9APPS) | |
| sudo scutil --set ComputerName "0x4d56423941505053" | |
| sudo scutil --set HostName "0x4d56423941505053" |