Skip to content

Instantly share code, notes, and snippets.

View BenMcLean's full-sized avatar

Benjamin McLean BenMcLean

View GitHub Profile
from kivy.clock import Clock
from kivy.core.window import Window
from kivy.uix.scatter import ScatterPlane
class Viewport(ScatterPlane):
def __init__(self, **kwargs):
kwargs.setdefault('size', (1920, 1080))
kwargs.setdefault('size_hint', (None, None))
kwargs.setdefault('do_scale', False)
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,
@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() {
@BenMcLean
BenMcLean / VirtualBoyGo.ps1
Last active July 12, 2019 01:19
VirtualBoyGo powershell
<#
.SYNOPSIS
Downloads VirtualBoyGo source code
.DESCRIPTION
Gathers all dependencies and places them in the correct folders!
.NOTES
Author : Benjamin McLean mclean.ben@gmail.com
.LINK
https://github.com/CidVonHighwind/VirtualBoyGo
#>
@BenMcLean
BenMcLean / .gitconfig
Created February 14, 2019 22:53
apply-gitignore alias for Git
[alias]
                apply-gitignore = !git ls-files -ci --exclude-standard -z | xargs -0r git rm --cached
// Pixelated font shader by lox9973
// It is a cutout shader, using alpha blending for 1 pixel antialiasing on the edges.
// Intended use is "3D Text" on an opaque object like a sign.
Shader "UI/PixelFont" {
Properties {
_MainTex ("Font Texture", 2D) = "white" {}
_Color ("Text Color", Color) = (1,1,1,1)
}
SubShader {
// Below Transparent queue. Renders after the skybox, but writes to depth.
@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.
@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)
$set(_year,$left($if2(%originaldate%,%date%),4))
$if(_year,%_year% )
%album%
$if($and(%releasetype%,$not($find(%releasetype%,album))), \(%releasetype%\))
($if2(%albumartist%,%artist%))
$if($eq($upper(%_extension%),MP3),, $upper(%_extension%))
/
$if($gt(%totaldiscs%,1),$if(%discsubtitle%,CD$num(%discnumber%,$len(%totaldiscs%)) %discsubtitle%/)$num(%discnumber%,$len(%totaldiscs%))-,)
$num(%tracknumber%,$if($gt($len(%totaltracks%),2),$len(%totaltracks%),2)) %title%
$if($find(%albumartist%,Various), \(%artist%\))
@BenMcLean
BenMcLean / quadraphonic-mka-to-surround51.bat
Last active May 27, 2022 15:15
Quadraphonic FLACs converted to fake 5.1 Surround FLACs
@ECHO OFF
cd %~dp0
for /f "eol=: delims=" %%F in ('dir /b /a-d *.mka ^| findstr /vixc:"%~nx0"') do ( ffmpeg.exe -i "%%F" -af "pan=5.1|FL=FL|FR=FR|BL=SL|BR=SR" "%%F.flac" )
@PAUSE