Skip to content

Instantly share code, notes, and snippets.

View jaf7's full-sized avatar

Anthony Fields jaf7

View GitHub Profile
@mraleson
mraleson / fernet.js
Last active March 14, 2024 16:24
Untested Javascript Fernet Decrypt
const crypto = require('crypto');
function base64UrlDecode(value) {
const translated = value.replace(/-/g, '+').replace(/_/g, '/');
const padding = translated.length % 4;
const padded = translated + '='.repeat(padding);
return Buffer.from(padded, 'base64');
}
function decrypt(secret, token, ttl) {
@jaf7
jaf7 / watch_log.py
Created November 1, 2021 18:25 — forked from albsen/watch_log.py
python log file watcher
#!/usr/bin/env python
"""
Real time log files watcher supporting log rotation.
Author: Giampaolo Rodola' <g.rodola [AT] gmail [DOT] com>
License: MIT
"""
import os

iPhone

Model(s) Physical Size Points (Standard) Points (Zoomed) Scale Device Resolution Screen Resolution
iPhone 16 Pro Max 6.9" 440 x 956 375 x 812 @3x 1320 x 2868 1320 x 2868
iPhone 16 Pro 6.3" 402 x 874 320 x 693 @3x 1206 x 2622 1206 x 2622
iPhone 16 Plus 6.7" 430 x 932 375 x 812 @3x 1290 x 2796 1290 x 2796
iPhone 16 6.1" 393 x 852 320 x 693 @3x 1179 x 2556 1179 x 2556
iPhone 15 Pro Max 6.7" 430 x 932 375 x 812 @3x 1290 x 2796 1290 x 2796
@hanayashiki
hanayashiki / ios-screen-size.json
Last active January 20, 2023 16:35
A dictionary of different iPhone screen sizes (until iPhone 12)
{
"iPhone 6": {
"height": 667,
"width": 375
},
"iPhone 7": {
"height": 667,
"width": 375
},
"iPhone 8": {
@jaf7
jaf7 / analyze.js
Created August 5, 2020 15:18 — forked from romanonthego/analyze.js
create-react-app bundle-analyzer
process.env.NODE_ENV = 'production';
const webpack = require('webpack');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const webpackConfigProd = require('react-scripts/config/webpack.config')('production');
// this one is optional, just for better feedback on build
const chalk = require('chalk');
const ProgressBarPlugin = require('progress-bar-webpack-plugin');
const green = text => {
@onlurking
onlurking / programming-as-theory-building.md
Last active March 28, 2025 02:18
Programming as Theory Building - Peter Naur

Programming as Theory Building

Peter Naur

Peter Naur's classic 1985 essay "Programming as Theory Building" argues that a program is not its source code. A program is a shared mental construct (he uses the word theory) that lives in the minds of the people who work on it. If you lose the people, you lose the program. The code is merely a written representation of the program, and it's lossy, so you can't reconstruct

@dcts
dcts / workbench.colorCustomizations.json
Created April 14, 2020 16:51 — forked from jacklorusso/workbench.colorCustomizations.json
A list of all Visual Studio Code customizable colors, grouped by UI region. Copy and paste into User Settings (comments are allowed) to tweak an existing theme or work on your own.
"workbench.colorCustomizations": {
// Contrast Colors - The contrast colors are typically only set for high contrast themes. If set, they add an additional border around items across the UI to increase the contrast.
"contrastActiveBorder": "",
"contrastBorder": "",
// Base Colors
"focusBorder": "",
"foreground": "",
"widget.shadow": "",
"selection.background": "",
"descriptionForeground": "",
@cgiovanii
cgiovanii / README.md
Last active January 28, 2022 22:57
.jsbeautifyrc files examples to use with my projects.

Usage

Copy this clean.jsbeautifyrc.json file to .jsbeautifyrc in your root project folder.

Precondition:

  • hookyqr.beautify is installed
  • .jsbeautifyrc exist
@OliverJAsh
OliverJAsh / README.md
Last active February 24, 2022 05:26
Flexbox gutters

Flexbox gutters

Problem

  • We use flexbox for our layout.
  • We want to add horizontal and vertical gutters inbetween these items.
  • Items wrap according to contents (flex-wrap: wrap), therefore we can't decide when/where to apply gutters using breakpoints.

Solution