Skip to content

Instantly share code, notes, and snippets.

View magneticflux-'s full-sized avatar
💾
Ctrl+S

Mitchell Skaggs magneticflux-

💾
Ctrl+S
  • Greater St. Louis Area, Missouri, USA, Earth, Sol system, Orion Arm, Milky Way, Laniakea Supercluster, The Universe
  • 10:25 (UTC -05:00)
View GitHub Profile
@LambdAurora
LambdAurora / optifine_alternatives_fabric.md
Last active February 19, 2024 09:42
Recommended OptiFine alternatives on Fabric

The list is moving out!

If you share this list, please use this link instead: https://lambdaurora.dev/optifine_alternatives

It may still be only a redirection link, but it will have a better web display of the list soon. And the list being on GitHub/GitHub pages improves load times.

The gist version of this list will stop being updated.

Why?

@Sturmlilie
Sturmlilie / apitrace-tutorial.md
Last active April 4, 2024 17:09
Debugging OpenGL issues in Minecraft mods using apitrace

Apitrace tutorial

Debugging OpenGL issues in Minecraft mods using apitrace

In the transition of Minecraft version 1.14 to 1.15, Mojang introduced some sweeping changes to the way rendering is performed; while the internal code still relies on GL1-era immediate-mode, block and entity renderer classes now provide their vertices to a specific RenderLayer* which are later rendered in ordered batches.

These changes broke a majority of Minecraft mods; in the process of porting a mod to 1.15, I had to frequently rely on a tool called “apitrace”, and I thought a quick how-to might come in handy for others struggling with similar problems. Apitrace allows capturing every OpenGL call an application makes, and later replaying these calls and inspecting the entire GL state machine at each rendering step.

For this tutorial, I am using the MultiMC launcher.

First step: Install apitrace

@rharter
rharter / SharedPreferenceLiveData.kt
Last active March 19, 2023 08:15
Creates LiveData objects that observe a value in SharedPreferences while they have active listeners.
import android.arch.lifecycle.LiveData
import android.content.SharedPreferences
abstract class SharedPreferenceLiveData<T>(val sharedPrefs: SharedPreferences,
val key: String,
val defValue: T) : LiveData<T>() {
private val preferenceChangeListener = SharedPreferences.OnSharedPreferenceChangeListener { sharedPreferences, key ->
if (key == this.key) {
value = getValueFromPreferences(key, defValue)
@codezjx
codezjx / CircleImageTransformation.java
Last active July 28, 2023 12:15
A picasso circle image transformation. Optimized version of: https://gist.github.com/julianshen/5829333. Use shader.setLocalMatrix() method to draw circle bitmap not from source bitmap left-top. So, we no need to create square bitmap!
/**
* Created by codezjx on 2016/5/4.
*/
public class CircleImageTransformation implements Transformation {
/**
* A unique key for the transformation, used for caching purposes.
*/
private static final String KEY = "circleImageTransformation";
@joubin
joubin / bypassSafeConnect.py
Last active July 13, 2020 17:37
This is a small script to bypass SafeConnect. SaveConnect is a small tool some universities use to manage you system. It installs their third party tool to monitor your usage and to check to see if you are running a virus scanner. The system is pretty flawed both in code and implementation. You can bypass it all together by running this.
#!/usr/bin/python
#
# Version 1.0
# This script will pass a linux HTML header causing safe connect to ignor the host mac address as safeconnect is not developed for *nix machines
# For educational purposes only.
# Joubin Jabbari
import sys
import urllib2
import random
@willurd
willurd / web-servers.md
Last active May 7, 2024 14:57
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@pmdgithub
pmdgithub / grab_avatars_for_git_users.pl
Created November 19, 2010 14:39
Grab avatars for github users, use for: gource --user-image-dir .git/avatar/
#!/usr/bin/perl
#fetch Gravatars
use strict;
use warnings;
use LWP::Simple;
use Digest::MD5 qw(md5_hex);
my $size = 90;