Skip to content

Instantly share code, notes, and snippets.

View BenMcLean's full-sized avatar

Benjamin McLean BenMcLean

View GitHub Profile
@dedunumax
dedunumax / .gitignore Java
Last active May 4, 2024 15:45
A complete .gitignore file for Java.
##############################
## Java
##############################
.mtj.tmp/
*.class
*.jar
*.war
*.ear
*.nar
hs_err_pid*
@henriquemenezes
henriquemenezes / android-generate-keystores.md
Last active May 2, 2024 21:33
Android: Generate Release/Debug Keystores

Android: Generate Release/Debug Keystores

Generate Keystores

Debug Keystore

$ keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "C=US, O=Android, CN=Android Debug"
@KdotJPG
KdotJPG / OpenSimplex2S.java
Last active April 29, 2024 17:30
Visually isotropic coherent noise algorithm based on alternate constructions of the A* lattice.
/**
* K.jpg's OpenSimplex 2, smooth variant ("SuperSimplex")
*
* More language ports, as well as legacy 2014 OpenSimplex, can be found here:
* https://github.com/KdotJPG/OpenSimplex2
*/
public class OpenSimplex2S {
private static final long PRIME_X = 0x5205402B9270C86FL;
version: "3"
services:
sftpgo:
image: "drakkan/sftpgo:v2-alpine"
# default user id
user: 1026
restart: always
expose:
# HTTP
- "8080"
@tansey
tansey / gist:1375526
Created November 18, 2011 03:40
Linear regression in C#
/// <summary>
/// Fits a line to a collection of (x,y) points.
/// </summary>
/// <param name="xVals">The x-axis values.</param>
/// <param name="yVals">The y-axis values.</param>
/// <param name="inclusiveStart">The inclusive inclusiveStart index.</param>
/// <param name="exclusiveEnd">The exclusive exclusiveEnd index.</param>
/// <param name="rsquared">The r^2 value of the line.</param>
/// <param name="yintercept">The y-intercept value of the line (i.e. y = ax + b, yintercept is b).</param>
/// <param name="slope">The slop of the line (i.e. y = ax + b, slope is a).</param>
@liamja
liamja / mirc.ini
Created April 28, 2013 14:26
Monokai colour scheme for mIRC.
[colors]
n5=Monokai,0,4,4,4,2,3,4,3,6,6,3,1,2,2,5,1,5,4,2,4,0,0,1,0,1,14,5,0,0,1
[palettes]
n5=2238503,15923448,15718758,3072678,7481081,12767183,2070525,26832,1632504,57344,94740,16776960,16515072,16711935,8355711,13816530
@BenMcLean
BenMcLean / JustTheTrackTitlesPlease.bat
Last active February 16, 2024 16:11
Gets just the track titles from MusicBrainz
@ECHO OFF
cd %~dp0
python.exe %~dpn0.py %1 %2 %3 %4 %5 %6 %7 %8
@PAUSE
@gunderson
gunderson / FlyCamera.cs
Last active January 15, 2024 16:31
Unity Script to give camera WASD + mouse control
using UnityEngine;
using System.Collections;
public class FlyCamera : MonoBehaviour {
/*
Writen by Windexglow 11-13-10. Use it, edit it, steal it I don't care.
Converted to C# 27-02-13 - no credit wanted.
Simple flycam I made, since I couldn't find any others made public.
Made simple to use (drag and drop, done) for regular keyboard layout
@BenMcLean
BenMcLean / powershell.bat
Last active October 30, 2022 22:57
Launch Powershell script .ps1 from identically named batch script .bat
@ECHO OFF
cd %~dp0
PowerShell.exe -NoProfile -ExecutionPolicy Bypass -Command "& '%~dpn0.ps1' %1 %2 %3 %4 %5 %6 %7 %8"
@PAUSE
@willnationsdev
willnationsdev / gdnative_guide_windows64debug.md
Last active June 16, 2022 14:41
A quick guide on building a GDNative C++ project

Creating a GDNative Library (Windows)

This guide specifically shows how to get a Windows 10 x64 OS compiled for a Windows x64 Debug dynamic library and integrate it into a Godot project.

To begin, make sure you are running the appropriate command line tool as an administrator.

Create a SimpleLibrary directory and enter it. This is where our Godot and GDNative projects will exist. For later use, we will also create subdirectories for libraries (lib) and source code (src). Once inside, we get a copy of each necessary repository for C++ NativeScript bindings generation and enter into the cpp_bindings directory.

mkdir SimpleLibrary