Skip to content

Instantly share code, notes, and snippets.

Avatar

Shilo Shilo

View GitHub Profile
@Shilo
Shilo / NSString+ComponentsLimit.h
Created Aug 31, 2013
NSString category for string splitting with a limit.
View NSString+ComponentsLimit.h
//
// NSString+ComponentsLimit.h
//
// Created by Shilo White on 8/31/13.
// Copyright (c) 2013 Shilocity Productions. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSString (ComponentsLimit)
@Shilo
Shilo / JavaSetTimeout.java
Last active Apr 21, 2021
Java "setTimeout" equivalent. (Credit: Oleg Mikhailov, http://stackoverflow.com/a/36842856)
View JavaSetTimeout.java
// Asynchronous implementation with JDK 1.8:
public static void setTimeout(Runnable runnable, int delay){
new Thread(() -> {
try {
Thread.sleep(delay);
runnable.run();
}
catch (Exception e){
System.err.println(e);
}
@Shilo
Shilo / strikethrough.js
Created Nov 5, 2020
Javascript to replace "~~" to html strikethrough tags.
View strikethrough.js
let string = "~~test string~~";
let i = 0;
string = string.replace(new RegExp("~~", 'g'), c => ++i % 2 ? "<s>" : "</s>");
@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]); })();
@Shilo
Shilo / ArchiveAndPackageApp.sh
Last active Aug 5, 2020
Bash shell script to clean, archive, and package xcode project. (Script extension can be renamed to .command to make it executable. Script must be located in the same directory as the .xcodeproj file)
View ArchiveAndPackageApp.sh
#!/bin/bash
#configurable variables
SCHEME_NAME="SCHEME-NAME-HERE"
DEVELOPER_NAME="iPhone Distribution: YOUR_DEVELOPER_NAME_HERE (ID_HERE)"
PROVISIONING_PROFILE="/ABSOLUTE/PATH/TO/PROVISIONING/PROFILE_HERE.mobileprovision"
USE_DEFAULT_DEVELOPER_NAME=true
USE_DEFAULT_PROVISIONING_PROFILE=true
OPEN_DIR_WHEN_FINISHED=false
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?