Skip to content

Instantly share code, notes, and snippets.

@qoomon
qoomon / conventional_commit_messages.md
Last active April 25, 2024 00:19
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@smkhalsa
smkhalsa / fade_on_scroll.dart
Last active April 25, 2024 00:14
A Widget that automatically fades its child based on scroll position
import 'package:flutter/material.dart';
class FadeOnScroll extends StatefulWidget {
final ScrollController scrollController;
final double zeroOpacityOffset;
final double fullOpacityOffset;
final Widget child;
FadeOnScroll(
{Key key,
@AdamWagner
AdamWagner / LevDis.gs
Created November 19, 2018 20:40
Levenshtein Distance Function for Google Sheets
//
// Levenshtein Distance Function for Google Sheets
//
// This function calculates de Levenshtein Distance (or Edit Distance) between two strings.
// I used the algorith and code from Wikipedia (https://en.wikipedia.org/wiki/Levenshtein_distance)
// as a reference and just adjusted the code to be used on Google Sheets.
//
// By: Manoel Lemos / manoel@lemos.net / http://manoellemos.com
//
// IMPORTANT: I added some code in the begining of the function to try to solve the issues
@RamonWill
RamonWill / TkinterTemplate.py
Last active April 25, 2024 00:12
Tkinter GUI template
import tkinter as tk
from tkinter import messagebox
from tkinter import ttk
"""
Useful Links:
https://stackoverflow.com/questions/7546050/switch-between-two-frames-in-tkinter Most useful in my opinion
https://www.tutorialspoint.com/python/python_gui_programming.htm
https://anzeljg.github.io/rin2/book2/2405/docs/tkinter/index.html
@kamermans
kamermans / configure_docker0.sh
Last active April 25, 2024 00:11
Change the IP subnet of Docker's docker0 interface
#!/bin/sh -e
#
# NOTE: Since Docker 1.10 (February 4, 2016), it has been possible to configure the
# Docker daemon using a JSON config file. On Linux, this file is normally located at
# /etc/docker/daemon.json. You should use this JSON config method if you are running
# a version of Docker that is at least 1.10!
# Here is an example configuration that sets the docker0 bridge IP to 192.168.254.1/24:
# {
# "bip": "192.168.254.1/24"
# }
@barronh
barronh / earthjsonfromwrf.py
Last active April 25, 2024 00:11
Creates a json in the format required by earth[1] from Weather Research and Forecasting (WRF) outputs.
from __future__ import print_function, unicode_literals
import os
import json
import numpy as np
from netCDF4 import Dataset
import argparse
from argparse import RawDescriptionHelpFormatter
import React, { createContext } from 'react';
import { useWindowDimensions, View } from 'react-native';
import Animated, {
useAnimatedStyle,
useSharedValue,
withSpring,
} from 'react-native-reanimated';
import { LinearGradient } from 'expo-linear-gradient';
import { Stack } from 'expo-router';
import { COLORS } from '@/constants';
@taskylizard
taskylizard / fmhy.md
Last active April 25, 2024 00:02
/r/freemediaheckyeah, in one single file (view raw)
@LarryIsBetter
LarryIsBetter / Linux Laptop Optimizations.md
Last active April 24, 2024 23:58
Linux Laptop Optimizations

I have a website now that includes a more dumbed down but straight forward version of this guide that isnt basied towards Arch Linux but considers most distros. https://linuxguidance.net/improve-battery-and-optimize-your-linux-laptop/

Everything I do in this guide is mostly taken from the Arch Wiki, and is for Arch Linux, obviously this can probably be applied to other Linux distributions especially Arch based ones, this guide is for people who want a laptop with similar effciency they had on Windows or MacOS. I hate the excuse of having to compromise on Linux to have good battery or thermals on laptops.

Please think of this guide as more of a starting point, if you're serious about fully optimizing your laptop research your laptop and the hardware inside of it as that can get you even further down the rabbit hole.

This guide assumes you have a relatively modern laptop with at least an SSD from the factory, if you don't, don't worry you can still probably follow this guide perfectly, if you have a 32-b

/**
* Check out the blog post, "How to mock a third party ES6 export in Vitest", at:
* https://dev.to/erikpuk/how-to-mock-a-third-party-es6-export-in-vitest-38ff
*/
// Import the module:
import * as Firestore from "firebase/firestore"
import { test, vi } from "vitest"
type FakeFirestore = { onSnapshot(this: void): void }