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 / _how_to_in_chrome.md
Last active Sep 27, 2019
Hide Twitch subscription badges. Why? I don't know. For fun.
View _how_to_in_chrome.md

In chrome desktop browser:

  • Copy the below text of "hide_subs_badset.js" file.
  • Go to the tab of the active twitch channel you want to hide the subscription badges.
  • Press Ctrl+Shift+J to open Javascript console window.
  • Paste the previously copied text in the console window and press enter.
  • Enjoy the hidden badges, because I don't know. For fun?
@Shilo
Shilo / CameraExtensions.cs
Last active Jul 4, 2019
Unity camera extensions to hide/show specific layers.
View CameraExtensions.cs
using UnityEngine;
public static class CameraExtensions {
public static void LayerCullingSetVisible(this Camera cam, int layerMask, bool visible) {
if (visible) LayerCullingShow(cam, layerMask);
else LayerCullingHide(cam, layerMask);
}
public static void LayerCullingSetVisible(this Camera cam, string layer, bool visible) {
if (visible) LayerCullingShow(cam, layer);
@Shilo
Shilo / logcat_unity_debug.bat
Last active Jul 4, 2019
Command prompt command to trace Unity logs in runtime on android via logcat.
View logcat_unity_debug.bat
adb logcat -s Unity ActivityManager PackageManager dalvikvm DEBUG
@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 / price_censor.js
Created Feb 11, 2019
Javascript snippit to hide/censor price tags on a website. (Note: seems to break interaction with the site, use at own risk)
View price_censor.js
(function(context) {
var priceCensor = "X.XX";
var pattern=/(\$)(\d([\d\,\.]+)?)/g,
callback=function(_,dollar,price) {
price=price.replace(/,/g,'');
return dollar + price;
},
html = context.innerHTML.replace(pattern,callback);
context.innerHTML = html;
})(document.body);
@Shilo
Shilo / ReplaceSelectedText.ahk
Created Feb 6, 2019
AutoHotkey script to replace selected text.
View ReplaceSelectedText.ahk
^space::
oCB := ClipboardAll
Clipboard =
Send ^c
ClipWait,1
beforeText := "BEFORE_TEXT_HERE"
afterText := "AFTER_TEXT_HERE"
Clipboard := beforeText . Clipboard . afterText
Send ^v
Clipboard := oCB
@Shilo
Shilo / angle-between-points.js
Created Sep 4, 2018 — forked from conorbuck/angle-between-points.js
JavaScript: Find the angle between two points
View angle-between-points.js
var p1 = {
x: 20,
y: 20
};
var p2 = {
x: 40,
y: 40
};
@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 / jekyll_blog_quotes.md.html
Created Aug 17, 2018
Jekyll page that will list quotes in all the posts.
View jekyll_blog_quotes.md.html
---
layout: page
title: Recent Blog Quotes
menu_title: Quotes
menu: true
order: 4
---
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
@Shilo
Shilo / blogger_quotes.js
Last active Aug 17, 2018
Blogger page that will list quotes in all the posts.
View blogger_quotes.js
<script>
$(document).ready(function () {
var feed = "/feeds/posts/default?alt=rss";
$.ajax(feed, {
accepts: {
xml: "application/rss+xml"
},
dataType: "xml",
error: function (xhr, status, error) {
var contentsDiv = $("#contents");
You can’t perform that action at this time.