Skip to content

Instantly share code, notes, and snippets.

@nebulazorua
nebulazorua / FixedOffsetsCharacter.hxc
Created May 7, 2024 12:56
fixes scaled offsets in V-Slice
import funkin.play.character.SparrowCharacter;
import funkin.play.character.CharacterType;
import funkin.play.PlayState;
import flixel.math.FlxPoint;
// make sure to change the charcter class name per character
// make sure to change it from SparrowCharacter to Atlas or MutliSparrow depending on your character, too
// also change the string in the super so it applies to the character you want to apply it to
@adriacidre
adriacidre / systemctl.md
Last active May 7, 2024 14:43
Systemctl Cheatsheet

Service Management

Starting and Stopping Services

Starting

sudo systemctl start application.service

or simply

sudo systemctl start application
@Sal7one
Sal7one / HeartShape.kt
Created May 5, 2024 07:00
Animated heart jetpack compose, with gaps
// infinite with gap of 1
@Composable
fun AnimatedHeartShapeRaw(
brush: Brush = Brush.verticalGradient(colors = listOf(Color.Magenta, Color.Magenta)), // Default gradient from Magenta to Blue
) {
val animationPercentage = remember { Animatable(0f) } // Animation state from 0 to 1
LaunchedEffect(Unit) {
animationPercentage.animateTo(
@precurse
precurse / gist:af9907010ba597b5261f40fd5885660c
Last active May 7, 2024 14:43
FT2232H Mini Pinout (JTAG, SPI, UART, I2C)

I made this reference guide so I can easily look back on it quickly.

FT2232H IC FT2232H Mini JTAG SPI UART I2C
GND CN2-2, 4, 6 GND GND GND GND
VCC CN2-1, 3, 5 3.3VDC 3.3VDC 3.3VDC 3.3VDC
AD0 CN2-7 TCK SCLK TXD SK
AD1 CN2-10 TDI DO (MOSI) RXD DO
AD2 CN2-9 TDO DI (MISO) DI
@zstepek
zstepek / mightyswarm_wc_remove_product_meta.php
Last active May 7, 2024 14:42
Remove product meta (SKU, tags, etc) from WooCommerce single product pages.
/* Remove product meta */
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );
@maratori
maratori / .golangci.yml
Last active May 7, 2024 14:41
Golden config for golangci-lint
# This code is licensed under the terms of the MIT license https://opensource.org/license/mit
# Copyright (c) 2021 Marat Reymers
## Golden config for golangci-lint v1.58.0
#
# This is the best config for golangci-lint based on my experience and opinion.
# It is very strict, but not extremely strict.
# Feel free to adapt and change it for your needs.
run:
@lordlycastle
lordlycastle / BaseSingleton.cs
Last active May 7, 2024 14:41
Abstract singleton class for Unity.
using System.Linq;
using UnityEngine;
/// <summary>
/// Abstract singleton class for Unity. Updated with possible errors:
/// - Doesn't create a new singleton if it is in scene.
/// - Singleton has an initialize method which is called on creation, finding one from scene, or awake. Which makes sure initialization always happen before using it.
/// - It doesn't create a new single if you try to access it OnDestroy (e.g. game quit). Returns null instead.
/// </summary>
/// <typeparam name="TSingleton">Type of singleton. (Same as class inheriting from it.)</typeparam>
@ChathuraHettiarachchi
ChathuraHettiarachchi / MotionLayoutTry.kt
Last active May 7, 2024 14:36
This is a sample implementation of AirBnB search bar transition on Android usin Jetpack Compose MotionLayout, MotionScene with DSL. You need to replace the images on `destinations` to work this. FInd the video link https://twitter.com/i/status/1778640663086829622
package com.chootadev.composetryout
import androidx.annotation.DrawableRes
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.keyframes
import androidx.compose.animation.core.tween
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
@danielzen
danielzen / nvm-lazy.sh
Last active May 7, 2024 14:36
nvm lazy-load for zsh
# This script should be sourced from .zprofile to take advantage of the $ZSH_EXECUTION_STRING check
export NVM_DIR="$HOME/.nvm"
export NVM_SYMLINK_CURRENT=true
NODE_VERSION_DIR=$(readlink ~/.nvm/current) # Assumes ~/.nvm/current is linked
__NODE_GLOBALS=("${(@f)$(find "$NODE_VERSION_DIR"/bin -maxdepth 1 -mindepth 1 -type l -print0 | xargs --null -n1 basename | sort --unique)}")
__NODE_GLOBALS+=(node nvm)
found=false
for value in "${__NODE_GLOBALS[@]}"; do
# if zsh is trying to execute a command that matches one of the node globals in the current version
@f-o
f-o / Jigidi-Magic-Stripes.js
Created January 27, 2024 08:39
Userscript to streamline Jigidi solving
// ==UserScript==
// @name Jigidi Magic Stripes
// @namespace me.danq.com.jigidi.magicstripes
// @match https://www.jigidi.com/solve/*
// @grant GM_getValue
// @grant GM_setValue
// @version 1.1
// @author Dan Q <https://danq.me>
// @description 23/03/2023, 14:32:30
// ==/UserScript==