Skip to content

Instantly share code, notes, and snippets.

View luqasn's full-sized avatar

Lucas Romero luqasn

View GitHub Profile
@marcinkuptel
marcinkuptel / SlideMenuController.cs
Last active September 3, 2017 19:42
SlideMenuController - Advanced UI with Xamarin.iOS
using System;
using Foundation;
using UIKit;
using System.Collections.Generic;
using System.Diagnostics;
using CoreGraphics;
namespace iOS
{
/// <summary>
@andymatuschak
andymatuschak / States-v3.md
Last active June 3, 2025 20:57
A composable pattern for pure state machines with effects (draft v3)

A composable pattern for pure state machines with effects

State machines are everywhere in interactive systems, but they're rarely defined clearly and explicitly. Given some big blob of code including implicit state machines, which transitions are possible and under what conditions? What effects take place on what transitions?

There are existing design patterns for state machines, but all the patterns I've seen complect side effects with the structure of the state machine itself. Instances of these patterns are difficult to test without mocking, and they end up with more dependencies. Worse, the classic patterns compose poorly: hierarchical state machines are typically not straightforward extensions. The functional programming world has solutions, but they don't transpose neatly enough to be broadly usable in mainstream languages.

Here I present a composable pattern for pure state machiness with effects,

@tcg
tcg / README.md
Created June 9, 2017 16:25
Raspberry Pi Zero W as Internet connected Access Point *and* Wireless Client

I wanted this capability for various reasons. It's not necessarily stable, because uap0 has to use the same channel as wlan0, and if you're traveling/mobile, wifi channels aren't necessarily predictable.

This is not a guide. This is just so I remember how to get back where I started, in case I wipe this thing. =)

Extremely helpful guides that got me here:

@wikrie
wikrie / fritzbox-cert-update.sh
Last active March 8, 2025 16:22
Fritzbox Fritz!Box AVM SSL Letsencrypt automatically update
#!/bin/bash
## this little Gist is for Copy the Letsencrypt Cert from an Linux machine (e.g. Raspberry PI or Synology NAS)
## to the router (Fritzbox).
## It is usefull to be able to speak to the Router over DDNS without any Cert issue in the Browser.
## thanks to https://gist.github.com/mahowi for the perfect Idea
## put it in /etc/letsencrypt/renewal-hooks/post so it gets run after every renewal.
## since Fritz OS 7.25 it is needed to select a Username, from a security point of view
## it is always a good idea to have a non default user name. And as normaly a Fritz Box
## is connected to the Internet, the prefered method should be WITH Username.
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active June 23, 2025 06:50 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export your tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.

@romainl
romainl / vanilla-linter.md
Last active June 10, 2025 22:19
Linting your code, the vanilla way

Linting your code, the vanilla way

You may want a linter plugin to lint your code in Vim but you probably don't need it. At least try the built-in way before jumping on the plugin bandwagon.

Defining makeprg

autocmd FileType <filetype> setlocal makeprg=<external command>

This autocommand tells Vim to use <external command> when invoking :make % in a <filetype> buffer. You can add as many similar lines as needed for other languages.

@shihanng
shihanng / .chunkwmrc
Last active January 6, 2024 04:17
chunkwm + skhd
#!/bin/bash
#
# NOTE: specify the absolutepath to the directory to use when
# loading a plugin. '~' expansion is supported.
#
chunkc core::plugin_dir /usr/local/opt/chunkwm/share/chunkwm/plugins
#
package statemachine
import debug
import fail
import io.reactivex.Observable
import kotlinx.coroutines.experimental.channels.Channel
import kotlinx.coroutines.experimental.channels.produce
import kotlinx.coroutines.experimental.delay
import kotlinx.coroutines.experimental.launch
import kotlinx.coroutines.experimental.runBlocking
@jahkeup
jahkeup / configuration.nix
Created April 21, 2018 22:17
NixOS qcow2 build
{ hostName, pkgs, ... }:
{
imports = [
./hardware.nix
];
networking.hostName = hostName;
time.timeZone = "America/Los_Angeles";
system.copySystemConfiguration = true;
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active June 18, 2025 19:09
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}