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 / 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;
@Shilo
Shilo / youtube_fullscreen_injection.js
Last active Jul 13, 2018
YouTube.com fullscreen injection to put the video in fullscreen. (Scrubber disabled due to issues with the fullscreen mode)
View youtube_fullscreen_injection.js
var sizeButton = document.getElementsByClassName("ytp-size-button")[0];
var sizeButtonTitle = sizeButton.getAttribute('title');
var shouldDefaultView = sizeButtonTitle != null && sizeButtonTitle.toLowerCase() == 'default view';
if (shouldDefaultView) {
sizeButton.click();
}
setTimeout(function() {
var playButton = document.getElementsByClassName("ytp-play-button")[0];
@Shilo
Shilo / quietube_fullscreen_injection.js
Created Jul 11, 2018
Quiettube7.com fullscreen injection to put the video in fullscreen.
View quietube_fullscreen_injection.js
(function() {
var css = `
html, body {
height: 100%;
}
body {
overflow: hidden;
}
@Shilo
Shilo / css_injection.js
Last active Jul 11, 2018
One Line Javascript CSS Injection.
View css_injection.js
(function() { var css = `body{background-color:black;}`; var cssDiv = document.createElement('div'); cssDiv.innerHTML = '&shy;<style>' + css + '</style>'; document.body.appendChild(cssDiv.childNodes[1]); })();
@Shilo
Shilo / ping.js
Created Feb 26, 2018
Vylocity snippet to track ping/latency.
View ping.js
client
send data
Date.now()
Server
Send back Date.now()
Client
"Ping:"+ Date.now()-Math.float(Data)+"ms"
@Shilo
Shilo / open_world_warping.js
Created Feb 21, 2018
VyScript to implement open world warping. When colliding with the map edge, it will automatically warp to the next map. (Vylocity engine: http://vylocity.com/)
View open_world_warping.js
#define MAP_NAME_COORD_DELIMITER "_"
Mob/Player
onBump(pB)
if (pB == Map.void)
var warpMap = null
var warpX = this.xPos;
var warpY = this.yPos;
var warpMapCoords = this.get_outside_map_coords(this.mapName)
@Shilo
Shilo / map_void_collision.js
Last active Feb 21, 2018
VyScript to detect what side of map void the player bumps into. (Vylocity engine: http://vylocity.com/)
View map_void_collision.js
Mob/Player
onBump(pB)
if (pB == Map.void)
if (this.xPos == -this.xOrigin)
World.log("bumped against left void")
else if (this.yPos == -this.yOrigin)
World.log("bumped against top void")
else if (this.xPos == Map.getMapSize(this.mapName).xPos-this.xOrigin-this.width)
World.log("bumped against right void")
else
@Shilo
Shilo / gist:b3f581ef937dfc22466ca579176492d2
Created Jan 4, 2018 — forked from ozh/gist:4131243
Create dot files/directories (ie .file) on Windows
View gist:b3f581ef937dfc22466ca579176492d2

#How to create a .file or .folder on Windows

There are several ways

1. Rename

  • Create file.txt
  • Rename to .file., the last dot will be dropped, you'll have .file

Works the same with a file or a directory.

@Shilo
Shilo / spoilerAlert.plugin.js
Last active Dec 18, 2017 — forked from NanoAi/spoilerAlert.plugin.js
spoilerAlert.plugin.js
View spoilerAlert.plugin.js
//META{"name":"spoilerAlert"}*//
/*@cc_on
@if (@_jscript)
// _jscrupt stolen (not really) from noodlebox#0155!
// Offer to self-install for clueless users that try to run this directly.
var shell = WScript.CreateObject("WScript.Shell");
var fs = new ActiveXObject("Scripting.FileSystemObject");
var pathPlugins = shell.ExpandEnvironmentStrings("%APPDATA%\\BetterDiscord\\plugins");
var pathSelf = WScript.ScriptFullName;
@Shilo
Shilo / ViewController.swift
Created Jul 31, 2017
Swift snippet for jumping to a specific PDF page in WKWebView.
View ViewController.swift
func webViewGotoPDFPage(index: Int) {
if (index < 1) { return; }
let pageCount = totalPDFPages(filePath: webViewLastURL!);
let pageIndex = max(min(index, pageCount), 1)-1;
/*
let firstPage = self.webView.scrollView.subviews[2].subviews[0];
//let contentHeight = self.webView.scrollView.contentSize.height;
//let totalPaddingSize = CGFloat(PDF_INNER_PADDING)*(CGFloat(pageCount)-1) + CGFloat(PDF_OUTER_PADDING)*2;
You can’t perform that action at this time.