Skip to content

Instantly share code, notes, and snippets.

@mpfaff
mpfaff / osg-aoda-certificate.js
Created September 8, 2023 17:31
Speedrun your OSG "Accessibility for Ontarians with Disabilities Act" certificate
const fs = require("fs");
const { randomUUID } = require("crypto");
async function register({email, name, company, phone}) {
const body = JSON.stringify({ email, full_name: name || "", company: company || "", phone: phone || "" });
console.log(body);
return await fetch("https://0rxyymz0p0.execute-api.ca-central-1.amazonaws.com/prod/user", {
"credentials": "omit",
"headers": {
@mpfaff
mpfaff / ontario-whsa-certificate.js
Last active September 8, 2023 17:13
Speedrun your "Worker Health and Safety Awareness in 4 Steps"
function getCertificate(firstName, lastName, course, forceDownload, language, email) {
function base64Encode(data) {
var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
ac = 0,
enc = "",
tmp_arr = [];
if (!data) {
return data;
}
@mpfaff
mpfaff / main.dart
Created June 19, 2020 20:41
Example of TweenSequence<Color> for a PageView
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@mpfaff
mpfaff / README.md
Last active May 29, 2020 21:27
User JavaScript and CSS files

CSS Overrides

CSS overrides for websites. These themes all work on the User JavaScript and CSS Chrome extension. Try that extension before commenting that one of them doesn't work for you.

GitLab

gitlab.com.css

This is a dark theme I threw together in around 2 hours for GitLab, after being fed up with my eyes being on fire. This theme is not ready for everyday use.

Keybase proof

I hereby claim:

  • I am mpfaff on github.
  • I am mpfaff (https://keybase.io/mpfaff) on keybase.
  • I have a public key ASAQGYKY7QtsoOI9LE9ZoZvg9iyK6Xg2-7MZ4myg-E2BrQo

To claim this, I am signing this object:

@mpfaff
mpfaff / main.dart
Created September 27, 2019 17:50
Dart Concatenate Lists Example
void main() {
var a = [1,2,3];
var b = [3,2,4];
var ab = a + b;
print(ab);
}
@mpfaff
mpfaff / keybase.md
Last active September 25, 2019 11:30
Keybase Proof of Ownership

Keybase proof

I hereby claim:

  • I am mpfaff on github.
  • I am nucleusdev (https://keybase.io/nucleusdev) on keybase.
  • I have a public key ASB8ZXUXNJ8CRin6g8Q2w2Tis7r-XKLkfVylx4P0FQOagwo

To claim this, I am signing this object:

@mpfaff
mpfaff / gist:6f4dee01005876bba3591da16b9c5153
Last active August 23, 2019 15:10
BlockStack Proof of Ownership
Verifying my Blockstack ID is secured with the address 178mYep1d2mFAJxdJEC5b1hAQU64oA559A https://explorer.blockstack.org/address/178mYep1d2mFAJxdJEC5b1hAQU64oA559A
@mpfaff
mpfaff / simple-icons.json
Created June 8, 2019 00:15
Simple Icons
{
".NET": {
"title": ".NET",
"hex": "5C2D91",
"source": "https://docs.microsoft.com/en-us/dotnet/images/hub/net.svg",
"svg": "<svg role=\\"img\\" viewBox=\\"0 0 24 24\\" xmlns=\\"http://www.w3.org/2000/svg\\"><title>.NET icon</title><path d=\\"M3.1672 7.5655v8.749H4.19v-6.325a8.979 8.979 0 0 0-.0488-1.1998h.0384a2.9082 2.9082 0 0 0 .2784.5473l4.4973 6.9774h1.2569V7.5655H9.1904v6.1526a9.2574 9.2574 0 0 0 .0619 1.286h-.0234c-.0544-.1056-.173-.3002-.3553-.585L4.4964 7.5656zm9.315 0v8.749h4.65l.0048-.9599h-3.6087v-3.0331h3.1579V11.4h-3.1579V8.4916h3.3884v-.926zm5.4374 0v.926h2.5149v7.823h1.0216v-7.823H24v-.926zM.6534 15.067a.643.643 0 0 0-.4565.2062A.6719.6719 0 0 0 0 15.753a.6623.6623 0 0 0 .1968.4799.6479.6479 0 0 0 .4799.2015.6623.6623 0 0 0 .4799-.2015.6575.6575 0 0 0 .2015-.48.667.667 0 0 0-.2015-.4798.6575.6575 0 0 0-.4799-.2062.643.643 0 0 0-.0234 0z\\"/></svg>"
},
"500px": {
"title": "500px",
"hex": "0099E5",
@mpfaff
mpfaff / main.dart
Created May 31, 2019 20:55
Idiom: Iterate over Map keys and values
void main() {
var mymap = {'a':'b', 'c':1};
mymap.forEach((k, v) => print('Key=$k, Value=$v'));
}