Skip to content

Instantly share code, notes, and snippets.

Avatar

Shilo Shilo

View GitHub Profile
@Shilo
Shilo / PointerHandler.cs
Last active Sep 7, 2020
Unity class to handle pointer click events.
View PointerHandler.cs
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
namespace Shilo
{
public class PointerHandler : MonoBehaviour, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler
{
private UnityEvent _onLeftClick;
private UnityEvent _onMiddleClick;
@Shilo
Shilo / hide_discord_typing.js
Created Sep 1, 2020
Hide Discord typing status with one line Javascript CSS injection.
View hide_discord_typing.js
(function() { var css = `div[class^="typing"]{visibility:hidden !important;}`; var cssDiv = document.createElement('div'); cssDiv.innerHTML = '&shy;<style>' + css + '</style>'; document.body.appendChild(cssDiv.childNodes[1]); })();
@Shilo
Shilo / hide_blocked_messages.js
Created Aug 27, 2020
Hide Discord blocked messages with one line Javascript CSS injection.
View hide_blocked_messages.js
(function() { var css = `div[class^="blockedSystemMessage"]{display: none !important; padding: 0 !important;}`; var cssDiv = document.createElement('div'); cssDiv.innerHTML = '&shy;<style>' + css + '</style>'; document.body.appendChild(cssDiv.childNodes[1]); })();
View cross-browser-opacity.css
selector {
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";
filter: alpha(opacity=30);
-moz-opacity: 0.3;
-khtml-opacity: 0.3;
opacity: 0.3;
}
View preserve-pixelation.scss
@mixin pixelated {
-ms-interpolation-mode: nearest-neighbor; // IE 7+ (non-standard property)
image-rendering: -webkit-optimize-contrast; // Safari 6, UC Browser 9.9
image-rendering: -webkit-crisp-edges; // Safari 7+
image-rendering: -moz-crisp-edges; // Firefox 3.6+
image-rendering: -o-crisp-edges; // Opera 12
image-rendering: pixelated; // Chrome 41+ and Opera 26+
}
@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);
You can’t perform that action at this time.