Skip to content

Instantly share code, notes, and snippets.

View rhalff's full-sized avatar

Robbert Halff rhalff

  • Robbert Halff
  • Netherlands
View GitHub Profile
@rhalff
rhalff / org.verdaccio.launcher.plist
Created June 7, 2023 19:06 — forked from juanpicado/org.verdaccio.launcher.plist
verdaccio on mac as a service
# ~/Library/LaunchAgents/org.verdaccio.launcher.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.verdaccio.launcher</string>
<key>Program</key>
<string>/Users/user/Scripts/verdaccio.sh</string>
<key>RunAtLoad</key>
@rhalff
rhalff / _docker-migrate-aufs.md
Created April 24, 2023 11:16 — forked from marcelrv/_docker-migrate-aufs.md
Docker migrate to overlay2 from aufs script

Docker migrate to overlay2 from aufs script

Crazy that this is pretty much forced change without proper transition script

note. Based on https://www.sylvaincoudeville.fr/2019/12/docker-migrer-le-stockage-aufs-vers-overlay2/ NOT WORKING!!!! IF FOLLOWING THE ABOVE.. SOMEHOW THE CONTAINERS DO NOT RE-APPEAR!

The only way I found that is somewhat automated is the the docker-compose way..

Which is still not 100% and require manual fixing of stupid errors of the docker-compose tool (mainly things that ere not interpreted right, like dates & userIds that need to manually surrounded by quotes etc)

@rhalff
rhalff / esm-package.md
Created April 22, 2023 19:36 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@rhalff
rhalff / pop-os-switch-workspaces-with-super-number.sh
Created July 10, 2022 21:07
Pop!_OS Switch workspaces with super number
gsettings set org.gnome.mutter dynamic-workspaces false
gsettings set org.gnome.desktop.wm.preferences num-workspaces 8
gsettings set org.gnome.shell.keybindings switch-to-application-1 []
gsettings set org.gnome.shell.keybindings switch-to-application-2 []
gsettings set org.gnome.shell.keybindings switch-to-application-3 []
gsettings set org.gnome.shell.keybindings switch-to-application-4 []
gsettings set org.gnome.shell.keybindings switch-to-application-5 []
gsettings set org.gnome.shell.keybindings switch-to-application-6 []
gsettings set org.gnome.shell.keybindings switch-to-application-7 []
gsettings set org.gnome.shell.keybindings switch-to-application-8 []
@rhalff
rhalff / gist:9989a706cb3b082a2bbc
Last active April 4, 2022 20:04
git cheatsheet
git config --global alias.undo-commit 'reset --soft HEAD^'
Set your email address with the following command:
git config --global user.email "your_email@example.com"
Global gitignore:
git config --global core.excludesfile ~/.gitignore
Confirm that you have set your email address correctly with the following command.
@rhalff
rhalff / example.dart
Created February 15, 2019 02:05 — forked from sma/example.dart
A flutter example demonstrating a custom painter drawing selectable rects
class RectsExample extends StatefulWidget {
@override
_RectsExampleState createState() => _RectsExampleState();
}
class _RectsExampleState extends State<RectsExample> {
int _index = -1;
@override
Widget build(BuildContext context) {
@rhalff
rhalff / main.dart
Last active June 20, 2021 19:33
Generics oddness
class A {}
class B extends A {
String b() {
return 'b';
}
}
class C<T extends A> {
const C(this.c);
@rhalff
rhalff / queue_subject.dart
Created November 13, 2019 22:14
Replay subject - clear queue
import 'dart:async';
import 'dart:collection';
import 'package:rxdart/rxdart.dart';
class QueueSubject<T> extends Subject<T> implements ReplayObservable<T> {
final Queue<T> _queue;
final int _maxSize;
factory QueueSubject({
@rhalff
rhalff / add_local_trusted_ca_for_valid_https.md
Created December 20, 2020 19:49 — forked from mwidmann/add_local_trusted_ca_for_valid_https.md
Generating trusted SSL keys for development

Generating SSL keys for development

Installation

Thanks to minica it is very easy to create trusted SSL certificates that have a very long expiration date.

In order to get started you have to have the go tools installed and set up correctly in your environment.

Setup

@rhalff
rhalff / .osx
Created November 20, 2020 16:21 — forked from ryanpcmcquen/.osx
.osx
#!/usr/bin/env bash
# curl -o ~/.osx https://gist.githubusercontent.com/ryanpcmcquen/b2e608311f286a4ab3e1/raw/.osx && bash ~/.osx
###############################################################################
# General UI/UX #
###############################################################################
# Disable smart dashes as they’re annoying when typing code.
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false