Skip to content

Instantly share code, notes, and snippets.

View lukepighetti's full-sized avatar
🦞

Luke Pighetti lukepighetti

🦞
View GitHub Profile
@lukepighetti
lukepighetti / config.toml
Last active May 3, 2024 09:18
Helix – tree file picker... TODAY?!?
[keys.normal]
C-f = [":new", ":insert-output lf-pick", ":theme default", "select_all", "split_selection_on_newline", "goto_file", "goto_last_modified_file", ":buffer-close!", ":theme tokyonight_storm"]
@lukepighetti
lukepighetti / ultrawide-simple.js
Created February 17, 2023 02:23
My Amethyst Ultrawide Layout
const centerColumnWidthFactor = 0.4;
// Prioritizes center with adjustable width factor
// Fills column left, then right
// Then splits right column vertically
// Then splits left column vertically
function layout() {
return {
name: "Ultrawide Simple",
getFrameAssignments: (windows, screenFrame) => {
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>
Lumbra Hardwoods Inc. – 122 River Road, Milo, Me 04463 207-943-7415
</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat:400,700|Merriweather">
<style>
@media only screen and (max-width: 700px) {
@lukepighetti
lukepighetti / .zshrc
Last active April 9, 2024 11:59
zsh functions I use for Helix / Flutter development
function flutter-watch(){
local PID_FILE="/tmp/tf$$.pid"
tmux new-session \;\
send-keys "flutter run --pid-file=$PID_FILE" Enter \;\
split-window -v \;\
send-keys "npx -y nodemon -e dart -x \"cat $PID_FILE | xargs kill -s USR1\"" Enter \;\
resize-pane -y 5 -t 1 \;\
select-pane -t 0 \;
rm $PID_FILE;
}
import 'dart:io';
import 'package:mqtt_client/mqtt_client.dart';
import 'package:mqtt_client/mqtt_server_client.dart';
Future<void> main(List<String> arguments) async {
final client = MqttServerClient('mosquitto.local', '');
client.setProtocolV311();
client.keepAlivePeriod = 30;
await client.connect();
@lukepighetti
lukepighetti / .ignore
Last active October 30, 2022 14:41
My helix config plus commands I use every day in my Helix / Flutter workflows
*.lock
android
ios
linux
macos
web
windows
@lukepighetti
lukepighetti / list_tile_occluded_app_bar.dart
Created August 25, 2022 19:08
A way to update AppBar title based on what ListTile is being occluded https://twitter.com/luke_pighetti/status/1562871407960522755
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@lukepighetti
lukepighetti / tmi_emote.ts
Last active August 23, 2022 18:47
Parse Twitch message + emote spec
import assert from "assert";
main();
function main(): void {
const parsedMessage = parseEmotes(
"Yo Kappas Kappa Kappa yo",
{
"25": ["10-15", "16-21"],
},
@lukepighetti
lukepighetti / local_overlay.dart
Last active June 1, 2022 12:45
Overlay widgets in any context... only issue, hot reload is broken
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:tuple/tuple.dart';
import 'package:uuid/uuid.dart';
class LocalOverlayScope extends StatefulWidget {
const LocalOverlayScope({Key? key, required this.child}) : super(key: key);
final Widget child;