Skip to content

Instantly share code, notes, and snippets.


Shilo Shilo

View GitHub Profile
Shilo / export_aseprite_layers.bat
Created Apr 27, 2019
Batch script to automatically save Aseprite file into layer images for easy import into external animation applications such as Spine and Spriter Pro. (Batch script has to be in same directory and same filename as Aseprite file)
View export_aseprite_layers.bat
@echo off
@set ASEPRITE="C:\Program Files (x86)\Steam\steamapps\common\Aseprite\Aseprite.exe"
@set FILENAME="%~n0"
if exist %FILENAME% (
choice /c YN /m "Would you like to delete and recreate '%FILENAME%' directory "
if errorlevel == 2 goto save
if errorlevel == 1 goto delete
goto end
Shilo / aspect_fit_bounds_in_bounds.js
Last active Aug 21, 2018
Javascript snippet to aspect fit bounds in bounds.
View aspect_fit_bounds_in_bounds.js
aspectFitBoundsInBounds(src, dest, center=true) {
let WIDTH_KEY = "width";
let HEIGHT_KEY = "height";
let largerSide = src.height > src.width ? HEIGHT_KEY : WIDTH_KEY;
let smallerSide = largerSide == HEIGHT_KEY ? WIDTH_KEY : HEIGHT_KEY;
let aspectRatio = src[smallerSide]/src[largerSide];
src[largerSide] = dest[largerSide];
src[smallerSide] = dest[largerSide]*aspectRatio;
Shilo / youtube_big_theater_mode_injection.js
Last active Jul 13, 2018 "big theater mode" injection. Gives the video full height when in theater mode.
View youtube_big_theater_mode_injection.js
(function() {
var coverNavBar = true;
var css = `
ytd-watch:not([fullscreen])[theater] #player.ytd-watch {
height: ` + (coverNavBar?'':'calc(') + '100vh' + (coverNavBar?'':' - 56px)') + ` !important;
max-height: none !important;` + (coverNavBar?`
position: relative;
margin-top: -56px;
z-index: 9999;

Nightbot Commands (Selected)

Basic Counter (execute works for mod-only)

!commands add !countercmd -ul=moderator "The current counter is $(count) ."

Reset Counter Command (execute works for mod-only)

!commands add !resetcountercmd -ul=moderator -a=!commands edit !countercmd -c=0

matthewzring /
Last active Dec 3, 2020
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

Sweet Styles

Italics *italics* or _italics_

Underline italics __*underline italics*__

whaison / CSharpReNameFileNameExtention_And_Meta.cs
Last active May 30, 2019
Unity AssetDatabase.RenameAsset(path, newName); can not rename extension CSharpReNameFileNameExtention_And_Meta(string path,string newName) can chenge extension
View CSharpReNameFileNameExtention_And_Meta.cs
static public void CSharpReNameFileNameExtention_And_Meta(string path,string newName)
string[] pathArr = path.Split("/"[0]);
string tempStr = "";
for (int i = 0; i < pathArr.Length-1; i++)
tempStr = tempStr + pathArr[i]+"/";
string renameDir = tempStr;
Guendeli / ToastMessage.cs
Created Sep 28, 2016
a script to show Toast Messages on Android Unity3D Apps
View ToastMessage.cs
using UnityEngine;
public class ToastMessage : MonoBehaviour
string toastString;
string input;
AndroidJavaObject currentActivity;
AndroidJavaClass UnityPlayer;
AndroidJavaObject context;
Shilo /
Created Sep 6, 2016
Terminal command to add svn ignores via ".gitignore" file.
svn propset svn:ignore -RF .gitignore .
Shilo / NavigationController.m
Last active Jul 16, 2016
iOS - Dynamically load navigation bar title image with interpolation. How to use: Set navigation title as "{image_name_here}"
View NavigationController.m
- (void)viewDidLoad {
[super viewDidLoad];
[self loadNavigationBarTitleImage];
- (void)loadNavigationBarTitleImage {
NSString *title = self.navigationItem.title;
NSInteger prefixLength = NAV_TITLE_IMAGE_PREFIX.length;
Shilo /
Created Jul 16, 2016
Terminal command to append "@2x" to file names inside current directory.
for file in *; do mv "$file" "${file%.*}@2x.${file##*.}"; done
You can’t perform that action at this time.