Skip to content

Instantly share code, notes, and snippets.

Benjamin McLean BenMcLean

Block or report user

Report or block BenMcLean

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
View build.bat
@echo on
cd %~dp0
cd ..
git pull
git submodule update
cd build
cmake -GNinja ..
cmake --build .
@pause
@BenMcLean
BenMcLean / GreenPixel.cs
Created Aug 7, 2019
Steps to procedurally generate a texture in Godot
View GreenPixel.cs
// Steps to procedurally generate a texture in Godot
// 1. Make a PoolByteArray http://docs.godotengine.org/en/3.0/classes/class_poolbytearray.html#class-poolbytearray
// 2. Make an Image http://docs.godotengine.org/en/3.0/classes/class_image.html#class-image-create-from-data
// 3. Make a Texture https://docs.godotengine.org/en/3.0/classes/class_imagetexture.html#class-imagetexture-create-from-image
Image image = new Image();
image.CreateFromData(1, 1, false, Image.Format.Rgba8, new byte[] { 0, 255, 0, 255 });
ImageTexture it = new ImageTexture();
it.CreateFromImage(image);
@BenMcLean
BenMcLean / get-state.bat
Last active Jul 27, 2019
Oculus Quest ADB stuff
View get-state.bat
@ECHO OFF
c:
cd %APPDATA%
cd ..\Local\Android\Sdk\platform-tools
adb get-state
@BenMcLean
BenMcLean / 3dify-youtube.bat
Last active Jul 12, 2019
Uses https://ffmpeg.org/ to tag a video file as being SBS 3D. Just drag+drop the video file onto this batch file in same folder with ffmpeg.exe
View 3dify-youtube.bat
@ECHO OFF
cd %~dp0
ffmpeg -i %1 -vcodec libx264 -x264opts frame-packing=3 "%~n13D%~x1"
echo Output file is: "%~n13D%~x1"
@PAUSE
@BenMcLean
BenMcLean / VirtualBoyGo.ps1
Last active Jul 12, 2019
VirtualBoyGo powershell
View VirtualBoyGo.ps1
<#
.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 / log.txt
Created May 18, 2019
psptoolchain install result 2019-05-18
View log.txt
This file has been truncated, but you can view the full file.
Running dependency scripts
Running dependency script: 0000-pspdev-prefix.sh
Running dependency script: 0100-programs.sh
Running dependency script: 0200-headers.sh
Checking headers of libELF:
Checking for header elf.h... yes
Checking for header libelf.h... yes
Checking for header gelf.h... yes
Checking headers of libUSB (legacy):
@BenMcLean
BenMcLean / .gitconfig
Created Feb 14, 2019
apply-gitignore alias for Git
View .gitconfig
[alias]
                apply-gitignore = !git ls-files -ci --exclude-standard -z | xargs -0r git rm --cached
@BenMcLean
BenMcLean / darkplaces.service
Last active Oct 25, 2018
darkplaces-server as a systemd service on Ubuntu
View darkplaces.service
[Unit]
Description=This service spawns a Darkplaces Quake dedicated server.
# Place this file in /lib/systemd/system
# To enable this service to launch at boot time, enter in a terminal: systemctl enable darkplaces.service
# To disable this service from launching at boot time, enter in a terminal: systemctl disable darkplaces.service
# To check the state of all existing unit files, enter in a terminal: systemctl list-unit-files
# I followed these instructions to install Darkplaces, except for the parts about starting the dedicated server on boot because those parts don't work anymore: https://ubuntuforums.org/showthread.php?t=2095900
# I based this service on https://github.com/cdev-tux/q3lite/blob/ba3f578b0dc93f2af645724fad283e7484b8d77e/misc/q3lite/pi/q3lite_ded.service
[Service]
@BenMcLean
BenMcLean / TestApp.java
Last active Oct 6, 2018
Simple libGDX app
View TestApp.java
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.utils.viewport.FitViewport;
@BenMcLean
BenMcLean / movegit.bat
Created Sep 25, 2018
Batch file to transfer a Git repository to a different remote repo
View movegit.bat
for %%g in ("%1") do set "Folder=%%~nxg"
mkdir %Folder%
cd %Folder%
git clone --mirror %1
cd %Folder%.git
git config --unset core.bare
git reset --hard
git remote remove origin
git remote add origin %2
git push -u origin --all
You can’t perform that action at this time.