Skip to content

Instantly share code, notes, and snippets.

@rob-hills
rob-hills / ubuntu-22.04-mbp-a1707.md
Last active May 3, 2024 17:33
Ubuntu 22.04 on MacBook Pro 2017 (A1707, MBP 14,3)

Summary

Random set of notes and links that have helped me in the saga to get Ubuntu 22.04 up and running on my 2017 MacBook Pro These notes are mainly for myself in the event that I have to do this again some day. But if you find them helpful, that's great.

Important update

Unfortunately the MacBookPro that I bought second hand turned out to be a dud with some serious hardware flaws that didn't show up until a couple of months after I'd bought it.

I've since purhcased another laptop so I'm not going to be able to maintain this GIST.

I'll leave it here for now in case others want to contribute updates, or clone it. If you feel it's out of date or misleading or a waste of time, let me know in the comments and I'll remove it.

import { zodResolver } from "@hookform/resolvers/zod";
import * as z from "zod";
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from '@/components/ui/form'; //shadcn ui folder
const MAX_FILE_SIZE = 1024 * 1024 * 5;
const ACCEPTED_IMAGE_MIME_TYPES = [
"image/jpeg",
"image/jpg",
"image/png",
"image/webp",
];
@Klerith
Klerith / vite-testing-config.md
Last active May 3, 2024 17:33
Vite + Jest + React Testing Library - Configuraciones a seguir

Instalación y configuracion de Jest + React Testing Library

En proyectos de React + Vite

  1. Instalaciones:
yarn add --dev jest babel-jest @babel/preset-env @babel/preset-react 
yarn add --dev @testing-library/react @types/jest jest-environment-jsdom
  1. Opcional: Si usamos Fetch API en el proyecto:
@RabaDabaDoba
RabaDabaDoba / ANSI-color-codes.h
Last active May 3, 2024 17:33 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes working in C!
/*
* This is free and unencumbered software released into the public domain.
*
* For more information, please refer to <https://unlicense.org>
*/
//Regular text
#define BLK "\e[0;30m"
#define RED "\e[0;31m"
#define GRN "\e[0;32m"
@fnky
fnky / ANSI.md
Last active May 3, 2024 17:31
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
Open up browser console, for Chrome, hit F12 and copy-paste and enter this
$("a").filter(function(index){return $(this).text()==="unsave"}).click();setTimeout(function(){location.reload();},500);
Repeat until all items are unsaved.
@CaptainVincent
CaptainVincent / README.md
Last active May 3, 2024 17:28
Improve your vscode quickinput-widget

Customize your quickinput-widget

This is a small tool designed to emulate the Sublime style Command Palette as follows.

Screenshot

It requires the use of a specific extension to load the js file from this gist.

I'm using the APC extension, and the usage is as follows.

@camh-
camh- / eol-at-eof.md
Created March 7, 2020 04:41
Please add newlines at end of files

See https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline

A newline in a text file is a terminator, not a separator. This means each line should have a newline at the end of it, including the last line of the file.

Many editors automatically add the newline at the end of the file. Some do not. If you can configure your editor to ensure there is always a newline at the end of every line, please do so.

Because many editors do add this newline, if you commit a text file without it, when someone else edits the file, their editor will (correctly) add the newline. This causes a spurious diff in the file. Spurious

@SeanPesce
SeanPesce / https_server.py
Last active May 3, 2024 17:26
Simple Python 3 HTTPS Server (SSL/TLS)
#!/usr/bin/env python3
# Author: Sean Pesce
# References:
# https://stackoverflow.com/questions/19705785/python-3-simple-https-server
# https://docs.python.org/3/library/ssl.html
# https://docs.python.org/3/library/http.server.html
# Shell command to create a self-signed TLS certificate and private key:
# openssl req -new -newkey rsa:4096 -x509 -sha256 -days 365 -nodes -out cert.crt -keyout private.key
@diasporx
diasporx / JetBrains products Activation code until 14 October 2024
Last active May 3, 2024 17:26
JetBrains products Activation code until 14 October 2024
I2A0QUY8VU-eyJsaWNlbnNlSWQiOiJJMkEwUVVZOFZVIiwibGljZW5zZWVOYW1lIjoiVU5JVkVSU0lEQURFIEVTVEFEVUFMIERFIENBTVBJTkFTIiwiYXNzaWduZWVOYW1lIjoiVGFvYmFv77yaSkVU5YWo5a625qG25r+AIOa0u+W3peS9nOWupCAgcmVuIHpodW4gZGlhbiBtaW5n77yBIiwiYXNzaWduZWVFbWFpbCI6IlJvYmJ5X1dlbmlnZXJAb3V0bG9vay5jb20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