Skip to content

Instantly share code, notes, and snippets.

View izackp's full-sized avatar

Isaac Paul izackp

View GitHub Profile
// NOTE: For best viewing experience, click "Raw" in the top right of the Gist page, or download
// this file and view it in your favorite text editor with syntax highlighting!
//==============================================
//| Title : SDL 2.0 API Quick Reference |
//| Author : https://github.com/dbechrd/ |
//| Last updated : Jan 8, 2023 |
//==============================================
// Based on: https://wiki.libsdl.org/SDL2/APIByCategory (retrieved Jan 8, 2023)
@izackp
izackp / BlurImageView.java
Created November 10, 2021 21:08 — forked from bartektrail/BlurImageView.java
BlurImageView allows to dynamically blur an image and smoothly pass from sharp to fully blurred image. It's extended ImageView.
package pl.snowdog.material.view;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.renderscript.Allocation;
@izackp
izackp / Bandit.entity.json
Created July 20, 2021 01:56
Experiment Character Controller in JSON. Mostly just high level components, actions, and event handlers that can be mapped around pretty easily. State is stored via stack; by pushing and popping components (behavior). Falls short of usefulness mostly through readability. Perhaps that could be solved with a UI builder and live preview.
{
"$type":"Models.Components.ComponentGroupVersioned",
"version": 0.1,
"subcomponents": [
{
"$type": "Models.Components.CharacterComponent",
"displayName": "Bandit",
"componentRefs":["DefaultSkin", "Body", "BodyStack", "Feet", "FeetStack", "Target"]
},
{
@izackp
izackp / disableDriveMetadata.sh
Last active July 14, 2021 00:46
Script to disable volume meta on MacOS (OSX)
#!/bin/bash
printf "\n** Tool to disable metadata on volume **\n\n"
printf "Enable full disk access to delete files:\n"
printf "\tSystem Preferences -> Security & Privacy -> Privacy -> Full Disk Access\n"
printf "\tAdd Terminal to have full disk access then restart the terminal\n\n"
DRIVENAME="/Volumes/$1"
if test -z "$1"
then
@izackp
izackp / UpdatingSwitchSoftware.md
Last active July 2, 2021 16:01
Updating Switch Software

Notes

Don't do any of this on a mac. Macos sets bits on file attributes as well as adds spotlight files and a ton of metadata files which interfer.

This is for a setup with emummc.

Steps

  1. Backup Hekate and atmosphere by copying bootloader atomosphere sept
  2. Download and overwrite atmosphere on the sd card (https://github.com/Atmosphere-NX/Atmosphere/releases)
    • Daybreak should be included
    • I used the version with mesosphere which is just an opensource version of the switch kernal.
@izackp
izackp / Guard.cs
Last active July 2, 2020 04:37
Needed a one liner guard function for C# that doesn't thrown an exception.
/*
Example Usage:
public int CalcScore(VideoResolution? itemResolution) {
if (Util.Guard(out VideoResolution res, itemResolution)) return 0;
if (res == VideoResolution._1080p) return 5;
return 1;
}
Alternatively you can do:
if (!(itemResolution is VideoResolution res)) return 0;
@izackp
izackp / dotnet_cheatsheet.md
Last active March 31, 2020 02:52
dotnet cli cheat sheet
Description Command
Create New Solution dotnet new sln
Create New Library dotnet new classlib -o library
Add Project to Solution dotnet sln add library/library.csproj
Add Nueget Package to Project dotnet add library package Newtonsoft.Json
Fix Dependencies dotnet restore
Build Solution dotnet build
Create Unit Test Project dotnet new xunit -o test-library
Add P
@izackp
izackp / banned.h
Last active August 29, 2019 18:29
Complicated functions that are they're too easy to misuse https://github.com/git/git/blob/master/banned.h
//https://github.com/git/git/blob/master/banned.h
/*
There are a few standard C functions (like strcpy) which are
easy to misuse. E.g.:
char path[PATH_MAX];
strcpy(path, arg);
may overflow the "path" buffer. Sometimes there's an earlier
constraint on the size of "arg", but even in such a case
@izackp
izackp / VCExample.swift
Last active July 10, 2019 14:46
Small example of ViewController organization that I can refer to, so my code can be more consistent.
class VCExample: BaseViewController {
// IBOutlets
// MARK: - Public Vars
// MARK: - Private Vars
// MARK: - Init
// MARK: - View Lifecycle