Skip to content

Instantly share code, notes, and snippets.

Isaac Paul izackp

Block or report user

Report or block izackp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@izackp
izackp / dotnet_cheatsheet.md
Last active Mar 31, 2020
dotnet cli cheat sheet
View dotnet_cheatsheet.md
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 Aug 29, 2019
Complicated functions that are they're too easy to misuse https://github.com/git/git/blob/master/banned.h
View 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 Jul 10, 2019
Small example of ViewController organization that I can refer to, so my code can be more consistent.
View VCExample.swift
class VCExample: BaseViewController {
// IBOutlets
// MARK: - Public Vars
// MARK: - Private Vars
// MARK: - Init
// MARK: - View Lifecycle
@izackp
izackp / APIRequest.kt
Last active Jun 19, 2019
(Code Saved For Later) Callback interface for android api requests without livedata. Not plugnplay but that shouldn't be a problem. It could probably be done with one less class...
View APIRequest.kt
package any
import android.util.Log
import any.model.AppException
import any.model.NetworkState
import any.LiveModelCallback2
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
@izackp
izackp / DataStructures.md
Last active Jan 15, 2019
List of Data Structures for User Configuration
View DataStructures.md

Comment or DM me to add to the list:

See: http://seriot.ch/parsing_json.php - Parsing JSON is a minefield. Notice how all of these json parsers are not up to spec. If they can't get it to spec then imagine the possible security issues with a format as simple as JSON.

JSON - Extremely Popular and Supported. Relatively easy to read.
XML - Old and Ugly. Widely supported. Useful if you need namespaces.
YAML - Popular format with Ruby and other server stuff. Apparently, a pain to implement and known to be insecure.
TOML - Simple configuration format. Some similarities to json. Complex arrays of objects suck tho.
HOCON - Very flexibile version of json. Probably the best for user experience (imho).
JSON5 - Another flexible version of json. Not as flexible as others, but it has most of the important features.

@izackp
izackp / ChangeGraphicsOSXSim.md
Created Sep 5, 2018
For some reason the iPhone SE simulator doesn't work on my laptop without changing the backing graphics driver
View ChangeGraphicsOSXSim.md

defaults write com.apple.CoreSimulator.IndigoFramebufferServices FramebufferEmulationHint 1

(1 = Metal, 2 = force use of OpenGL, 3 = OpenGL)

@izackp
izackp / CircularReferenceExample.md
Last active Jun 15, 2017
Circular Reference Reminder
View CircularReferenceExample.md
NavController {
	->ViewController
}

ViewController {
	->Table {
		Row {
			Action->ViewController.OnClick
		}
	}
@izackp
izackp / HypothenuseBenchmarks.cs
Last active May 26, 2017
Benchmarking Different Hypotenuse Algorithms
View HypothenuseBenchmarks.cs
/*
Starting Speed Test for 100000000 iterations
Distance_Normal: 17187ms AvgErr: 0.00% MaxErr: 0.00%
Distance_Sqrt2: 585 ms AvgErr: 5.28% MaxErr: 8.24%
Distance_4142: 623 ms AvgErr: 5.28% MaxErr: 8.24%
Distance_4142_Cast: 3824 ms AvgErr: 5.28% MaxErr: 8.24%
Distance_4142_Int_Only: 584 ms AvgErr: 5.28% MaxErr: 8.24%
Distance_4142_Int_Only_Manual_Inlined: 666 ms AvgErr: 5.28% MaxErr: 8.24%
Distance_AShift1: 606 ms AvgErr: 8.84% MaxErr:11.80%
Distance_337: 613 ms AvgErr: 3.38% MaxErr: 5.52%
@izackp
izackp / ConfigCamera.cs
Last active Apr 4, 2017
Zoom While Maintaining Pixel Perfect Ratio
View ConfigCamera.cs
using UnityEngine;
public class ConfigCamera : MonoBehaviour {
public float Zoom = 1.0f;
float _pixelsPerUnit = 1.0f; //Set this to whatever you set for your texture
public float ScreenWidth; //For Debugging
public float ScreenHeight; //For Debugging
Rect _bounds;
@izackp
izackp / PBKDF2.cs
Last active Sep 6, 2016
PBKDF2 simplified interface in C# - To anyone reading this: just use the BCrypt library its simpler and safer.
View PBKDF2.cs
using System;
using System.Security.Cryptography;
namespace Security
{
public static class PBKDF2
{
const int cSaltByteLength = 24;
const int cDerivedKeyLength = 24;
const int cIterationCount = 2;
You can’t perform that action at this time.