Skip to content

Instantly share code, notes, and snippets.

@PsychedelicShayna
PsychedelicShayna / md5.rs
Last active May 10, 2024 03:18
A condensed, 358 line MD5 implementation for Rust, easy to copy paste into other projects.
pub mod md5 {
use std::convert::TryInto;
use std::fmt::Display;
use std::{fs::File, io::Read};
pub const BLOCK_LENGTH: usize = 64;
pub const DIGEST_LENGTH: usize = 16;
#[rustfmt::skip]
pub const INITIAL_STATE: [u32; 4] = [
@Micemade
Micemade / woocommerce-cart-item-coupon-price.php
Last active May 10, 2024 03:17
WooCommerce display price with applied coupon(s) per item in cart
<?php
/**
* Woocommerce cart - display prices with coupons applied, per cart item.
*
* @param string $subtotal
* @param array $cart_item
* @param string $cart_item_key
* @return $subtotal
*
* Inspired by:
@karlhillx
karlhillx / macos_big_sur_homebrew_apache_php_mariadb_2020.md
Last active May 10, 2024 03:16
macOS Big Sur 11.0 Setup: Homebrew + Apache + PHP + MariaDB (Regularly updated)

macOS Big Sur 11.0 Setup: Homebrew + Apache + PHP + MariaDB

This document helps get your macOS development environment up and running with the latest versions of Homebrew, Apache, PHP, and MariaDB.

Data Source=(localdb)\MSSQLLocalDb;Initial Catalog=MeetingCatalog;Trusted_Connection=True

@33eyes
33eyes / commit_jupyter_notebooks_code_to_git_and_keep_output_locally.md
Last active May 10, 2024 03:14
How to commit jupyter notebooks without output to git while keeping the notebooks outputs intact locally
  1. Add a filter to git config by running the following command in bash inside the repo:
git config filter.strip-notebook-output.clean 'jupyter nbconvert --ClearOutputPreprocessor.enabled=True --to=notebook --stdin --stdout --log-level=ERROR'  
  1. Create a .gitattributes file inside the directory with the notebooks

  2. Add the following to that file:

*.ipynb filter=strip-notebook-output  
@frolleks
frolleks / DECOMPILING_AN_ELECTRON_APP.md
Last active May 10, 2024 03:09
How to decompile an Electron app

Let me tell you how easy it is to decompile an Electron app (that's closed source).

Prerequisites

Decompilation

First of all, you find the install path of your Electron app. If you found it, find the resources folder. If you found it, you'll have to install asar globally, by running:

@WolfgangSenff
WolfgangSenff / gist:168cb0cbd486c8c9cd507f232165b976
Last active May 10, 2024 03:03
Godot 4.0 Migration/Upgrade guide
## For a beginner-friendly version of the following (more advanced users likely will get better use of the below,
## if you're just starting out...), see this new gist:
## https://gist.github.com/WolfgangSenff/0a9c1d800db42a9a9441b2d0288ed0fd
This document represents the beginning of an upgrade or migration document for GDScript 2.0 and Godot 4.0. I'm focusing on 2D
at the moment as I'm upgrading a 2D game, but will hopefully have more to add for 3D afterward.
## If you want more content like this, please help fund my cat's medical bills at https://ko-fi.com/kyleszklenski - thank you very much! On to the migration guide.
@chetan
chetan / yardoc_cheatsheet.md
Last active May 10, 2024 02:53
YARD cheatsheet
@tatumroaquin
tatumroaquin / wsl2-usbipd-kernel.md
Last active May 10, 2024 02:52
WSL2 custom kernel for usb support

WSL2 USB/IP Kernel Build

At the time of writing WSL 2 does not have official support for interfacing with USB type devices. To solve this, a fork of the usbip project is modified by Microsoft to allow virtual connectivity between USB devices on a host via the USB/IP protocol.

Though it is recommended to use the usbip from a Windows 11 host, there is a way to build a custom WSL2 Kernel in Windows 10 with usbip driver support enabled for USB Mass Storage devices.

This is a supplementary guide which allows for a more linear step by step instruction to eliminate the confusion introduced by the official documentation.

Install USB/IP Client

use std::fs::{File, remove_file};
use std::io::{Read, Write};
use orion::hazardous::{
aead::xchacha20poly1305::{seal, open, Nonce, SecretKey},
mac::poly1305::POLY1305_OUTSIZE,
stream::xchacha20::XCHACHA_NONCESIZE,
};
use orion::hazardous::stream::chacha20::CHACHA_KEYSIZE;