Skip to content

Instantly share code, notes, and snippets.

Shilo Shilo

Block or report user

Report or block Shilo

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
@Shilo
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
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
Shilo / youtube_big_theater_mode_injection.js
Last active Jul 13, 2018
YouTube.com "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;
View nightbot_commands_selected.md

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
matthewzring / markdown-text-101.md
Last active Nov 6, 2019
A guide to Markdown on Discord.
View markdown-text-101.md

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*__

@eslachance
eslachance / index.js
Last active Nov 17, 2019
Simple, complete example of a bot in Discord.js
View index.js
// Load up the discord.js library
const Discord = require("discord.js");
// This is your client. Some people call it `bot`, some people call it `self`,
// some might call it `cootchie`. Either way, when you see `client.something`, or `bot.something`,
// this is what we're refering to. Your client.
const client = new Discord.Client();
// Here we load the config.json file that contains our token and our prefix values.
const config = require("./config.json");
@whaison
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;
@Shilo
Shilo / svn_ignore.sh
Created Sep 6, 2016
Terminal command to add svn ignores via ".gitignore" file.
View svn_ignore.sh
svn propset svn:ignore -RF .gitignore .
@Shilo
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
#define NAV_PORTRAIT_HEIGHT 44
- (void)viewDidLoad {
[super viewDidLoad];
[self loadNavigationBarTitleImage];
}
- (void)loadNavigationBarTitleImage {
NSString *title = self.navigationItem.title;
NSInteger prefixLength = NAV_TITLE_IMAGE_PREFIX.length;
@Shilo
Shilo / filename_append_2x.sh
Created Jul 16, 2016
Terminal command to append "@2x" to file names inside current directory.
View filename_append_2x.sh
for file in *; do mv "$file" "${file%.*}@2x.${file##*.}"; done
You can’t perform that action at this time.