Skip to content

Instantly share code, notes, and snippets.

View whiplashoo's full-sized avatar

Minas Giannekas whiplashoo

View GitHub Profile
@whiplashoo
whiplashoo / AppDelegate.swift
Created June 21, 2023 14:24
Adding a Menu Bar extra (icon) to a Flutter macOS app
import Cocoa
import FlutterMacOS
import SwiftUI
// Relevant blog post: https://blog.whidev.com/menu-bar-extra-flutter-macos-app
struct Shortcut {
var combination: String
var description: String
var createdAt: Int
@whiplashoo
whiplashoo / abbr.js
Created May 26, 2023 05:45
Country and state abbreviations
STATE_ABBREVIATIONS = {
AB: "Alberta",
BC: "British Columbia",
MB: "Manitoba",
NB: "New Brunswick",
NL: "Newfoundland and Labrador",
NT: "Northwest Territories",
NS: "Nova Scotia",
NU: "Nunavut",
ON: "Ontario",
@whiplashoo
whiplashoo / resources.md
Last active June 1, 2022 15:26
Resources from "Building a native-looking desktop app with Flutter for macOS and Windows" presentation from Flutter Global Summit '22

No, your cryptocurrency cannot work

Whenever the topic of Bitcoin's energy usage comes up, there's always a flood of hastily-constructed comments by people claiming that their favourite cryptocurrency isn't like Bitcoin, that their favourite cryptocurrency is energy-efficient and scalable and whatnot.

They're wrong, and are quite possibly trying to scam you. Let's look at why.

What is a cryptocurrency anyway?

There are plenty of intricate and complex articles trying to convince you that cryptocurrencies are the future. They usually heavily use jargon and vague terms, make vague promises, and generally give you a sense that there must be something there, but you always come away from them more confused than you were before.

@whiplashoo
whiplashoo / hexOrRGBToColor.dart
Created April 23, 2021 08:23
Convert a hex, rgba, or rgb color string to Color object in Dart
import 'dart:ui';
import 'package:flutter/material.dart';
// Converts a hex, rgb, or rgba color string to Color object. Works with opacity values as well.
// e.g.:
// "#000" -> Color(0xff000000)
// "#cc3333" -> Color(0xffcc3333)
// "#cc3333dd" -> Color(0xddcc3333)
// "rgb(204, 44, 81)" -> Color(0xffcc2c51)
// "rgba(204, 44, 81, 0.20)" -> Color(0x33cc2c51)
@whiplashoo
whiplashoo / landkreise.svg
Created December 11, 2020 11:10
CustomPaint perf demo with GestureDetector
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@whiplashoo
whiplashoo / landkreise.svg
Created December 10, 2020 12:22
CustomPaint Performance demo
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.