Skip to content

Instantly share code, notes, and snippets.

@zacwest
zacwest / ios-font-sizes.swift
Last active March 5, 2025 07:33
iOS default font sizes - also available on https://www.iosfontsizes.com
let styles: [UIFont.TextStyle] = [
// iOS 17
.extraLargeTitle, .extraLargeTitle2,
// iOS 11
.largeTitle,
// iOS 9
.title1, .title2, .title3, .callout,
// iOS 7
.headline, .subheadline, .body, .footnote, .caption1, .caption2,
]
@Kartones
Kartones / postgres-cheatsheet.md
Last active March 5, 2025 07:32
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
<?php
/**
* Get the file size of any remote resource (using get_headers()),
* either in bytes or - default - as human-readable formatted string.
*
* @author Stephan Schmitz <[email protected]>
* @license MIT <http://eyecatchup.mit-license.org/>
* @url <https://gist.github.com/eyecatchup/f26300ffd7e50a92bc4d>
*
* @param string $url Takes the remote object's URL.
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active March 5, 2025 07:30 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export your tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.

@matthewtoast
matthewtoast / create-blitz-frontend-only-app.js
Created February 26, 2022 14:59
Script to create a frontend-only Blitz app
const cp = require("child_process")
const fs = require('fs')
const path = require('path')
const { argv } = process
const appName = argv[argv.length - 1]
if (!appName || appName.includes('.')) {
throw new Error('Please provide a valid app name')
}
// cp.execSync("yarn global add serve", { stdio: "inherit" })
// cp.execSync("yarn global add blitz", { stdio: "inherit" })
@rssnyder
rssnyder / oracle-cloud-free-tier-guide.md
Last active March 5, 2025 07:23
oracle-cloud-free-tier-guide

how to leverage oracle's temping offers

free tier limits

The limits of the free tier say that you can create up to 4 instances.

  • x2 x86 instances (2core/1g)
  • x2 ampere instances (with 4core/24g spread between them)
  • 200GB total boot volume space across all intances (minimum of 50G per instance)

create your account

@safijari
safijari / readme.org
Last active March 5, 2025 07:09
How to use Orange Pi 5B for 4k 120hz (non HDR) streaming with Moonlight

IMPORTANT: DON’T USE THIS GUIDE AS IS. GNOME HAS A WEIRD VSYNC ISSUES. Instead you can use the official Debian image and make sure all the updated drivers are installed and the rest should remain the same.

Preamble

This guide is made using the Orange Pi 5B 4GB+32GB. The device is capable of handling a 4k 120hz stream but you should know that the decode time for 4k stream hovers around 8ms and can spike up to 15ms during a benchmark. I can’t feel any added latency from it and I don’t have any dropped frames. The decode time goes down to 4ms for 1440p. It’s certainly not the blazing fast sub ms decode latency we get on the Steam Deck or mini PCs. I bought the device for $99 and for that price I think this performance is fantastic, but your mileage/expecations may vary.

How to get this result (or rather how I got it)

  1. Install the official Gnome Ubuntu Jammy image using Balena Etcher onto a 16+ GB microSD card
@adhipg
adhipg / countries.sql
Created January 12, 2012 11:41
Sql dump of all the Countries, Country Codes, Phone codes.
CREATE TABLE IF NOT EXISTS `country` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) NOT NULL,
`name` varchar(80) NOT NULL,
`nicename` varchar(80) NOT NULL,
`iso3` char(3) DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
`phonecode` int(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
@hortonew
hortonew / setup-bevy-0.15-project-for-android.sh
Last active March 5, 2025 07:02
setup-bevy-0.15-project-for-android.sh
#!/bin/zsh
# Grab PROJECT from Cargo.toml project.name
PROJECT=$(grep "name" Cargo.toml | cut -d '"' -f 2 | head -n 1)
PROJECT_ORG="bevyengine"
PROJECT_ORG_STRUCTURE="org.${PROJECT_ORG}.${PROJECT}"
BEVY_RELEASE="refs/heads/release-0.15.2"
echo "Creating new Bevy project: ${PROJECT} with organization structure: ${PROJECT_ORG_STRUCTURE}"
@kmcquade
kmcquade / jenkins-decrypt.md
Last active March 5, 2025 07:01 — forked from tuxfight3r/jenkins-decrypt.groovy
Decrypting Jenkins Password

To Decrypt Jenkins Passwords

  1. Go to the "Configure System" screen.
  2. Right click on a password field, Inspect element, then change to "text" instead of "password".
  3. Copy that field and then go to the Script Console. Paste the below into the field, replace with your encrypted password, and then hit "run".
encrypted_pw = '{your_encrypted_password_with_brackets_around_it}'
passwd = hudson.util.Secret.decrypt(encrypted_pw)
println(passwd)