Skip to content

Instantly share code, notes, and snippets.

View BenMcLean's full-sized avatar

Benjamin McLean BenMcLean

View GitHub Profile
@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
private void initialize() {
Coord.expandPoolTo(WIDTH+3, HEIGHT+3);
// Initialize the heightmap generator
ModuleFractal heightFractal = new ModuleFractal (ModuleFractal.FractalType.FBM,
ModuleBasisFunction.BasisType.GRADIENT,
ModuleBasisFunction.InterpolationType.QUINTIC);
heightFractal.setNumOctaves(terrainOctaves);
heightFractal.setFrequency(terrainFrequency);
heightFractal.setSeed(CommonRNG.getRng().between(0, Integer.MAX_VALUE));
ModuleFractal ridgedHeightFractal = new ModuleFractal (ModuleFractal.FractalType.RIDGEMULTI,
@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
@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"
@BenMcLean
BenMcLean / tictactoe.bat
Created March 10, 2016 04:32
Windows Batch Tic-Tac-Toe
@echo off
setLocal EnableDelayedExpansion
:newgame
cls
echo TIC-TAC-TOE
echo Written by Benjamin McLean
echo.
echo Controls:
echo|set /p="7 | 8 | 9"
echo.
@mayukojpn
mayukojpn / facebook-mass-delete-group-members.js
Last active November 8, 2018 05:11 — forked from michaelv/facebook-mass-delete-group-members.js
This javascript removes all users from a facebook group. It works with the new facebook layout. Paste this in the javascript console. Script tested in Firefox. Known issues: 1. when facebook responds slowly, the script might experience hickups.. 2. occasionially, the error 'this user is not a member of the group' pops up.. IMPORTANT: add your ow…
var deleteAllGroupMembers = (function () {
var deleteAllGroupMembers = {};
// the facebook ids of the users that will not be removed.
// IMPORTANT: add your own facebook id here so that the script will not remove yourself!
var excludedFbIds = ['1234','11223344']; // make sure each id is a string!
var usersToDeleteQueue = [];
var scriptEnabled = false;
var processing = false;
deleteAllGroupMembers.start = function() {
@KdotJPG
KdotJPG / OpenSimplexNoiseTileable3D.java
Created December 25, 2014 13:18
Tileable 3D OpenSimplex Noise
/*
* OpenSimplex Noise in Java.
* by Kurt Spencer
*
* Tileable 3D version, preliminary release.
* Could probably use further optimization.
*
* w6, h6, and d6 are each 1/6 of the repeating period.
* for x, y, z respectively. If w6 = 2, h6 = 2, d6 = 2,
* then the noise repeats in blocks of (0,0,0)->(12,12,12)
@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*
@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;
@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