Skip to content

Instantly share code, notes, and snippets.

View JLChnToZ's full-sized avatar
🥽
From game to XR experience

Jeremy Lam aka. Vistanz JLChnToZ

🥽
From game to XR experience
View GitHub Profile
var c=String.fromCharCode,s='var c=String.fromCharCode,s=#%#;console.log(s.replace(new RegExp(c(35),c(103)),c(39)).replace(c(37),s))';console.log(s.replace(new RegExp(c(35),c(103)),c(39)).replace(c(37),s))
@JLChnToZ
JLChnToZ / _mishiro-version-code.txt
Last active December 26, 2018 17:15
If 346 characters are used as development code names of some software, this might be the best ordering
v1.0 ANZU (双葉杏)
v2.0 CATHY (キャシー・グラハム)
v3.0 DOMYOJI (道明寺歌鈴)
v4.0 ETOU (衛藤美紗希)
v5.0 FUMIKA (鷺沢文香)
v6.0 HAJIME (藤原肇)
v7.0 IBUKI (小松伊吹)
v8.0 JOUMU (美城常務)
v9.0 KAEDE (高垣楓)
v10.0 LAYLA (ライラ)
if(!window.dndtabs)
(function(containerQuery, childrenQuery) {
let dragging;
const container = document.querySelector(containerQuery);
container.addEventListener('dragstart', e => {
if(!e.target.matches(childrenQuery)) return;
const { dataTransfer, target } = e;
dataTransfer.clearData();
dataTransfer.setData('application/x-tab-data', target.outerHTML);
@JLChnToZ
JLChnToZ / PersistentCallFinder.cs
Last active November 8, 2018 12:23
A simple editor tool that writes all persistent calls into a stub file
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
using System.Reflection;
using UnityEngine;
using UnityEditor;
using UnityObject = UnityEngine.Object;
import { createSocket, Socket } from 'dgram';
import { isIP } from 'net';
import { createServer } from 'http';
import { URL } from 'url';
import { lookup as dnsLookup } from 'dns';
import { unescape as unescapeQuery } from 'querystring';
import { promisify } from 'util';
const macAddressFormat = /[^0-9A-F]/g;
@JLChnToZ
JLChnToZ / SelectionHistory.cs
Last active August 27, 2018 16:19
Selection History for Unity Editor
using UnityEditor;
using System.Collections.Generic;
public static class SelectionHistory {
private const string PREV_SELECTED_MENU = "Edit/Previous Selection %&LEFT";
private const string NEXT_SELECTED_MENU = "Edit/Next Selection %&RIGHT";
private const int SELECTION_HISTORY_MENU_PRIORITY = 200;
private const int MAX_HISTORY_COUNT = 10;
private static readonly LinkedList<int[]> prevSelected = new LinkedList<int[]>();
@JLChnToZ
JLChnToZ / _readme.md
Last active April 17, 2024 04:12
Simple bookmarklet that captures any webpage and save as png image using HTML5 technologies

Webpage Snapshot Bookmarklet

This is a simple bookmarklet that captures any webpage and save as png image using HTML5 technologies. Under the hood it uses HTML2Canvas to capture the webpage to canvas, then we convert the content inside this canvas element to image file.

You may copy the text below and save as bookmark. `javascript:!function()%7Bfunction%20e()%7Bthis&&this.parentNode&&this.parentNode.removeChild(this),html2canvas(document.body).then(function(e)%7Breturn%20new%20Promise(function(t)%7Be.toBlob(t)%7D)%7D).then(function(e)%7Bvar%20t=document.createElement(%22a%22);return%20t.href=URL.createObjectURL(e),t.download=document.title.replace(/%5B/%5C%7C%5C%5C%60~!@#%5C$%25%5C%5E&%5C*%5C+%5C-='%22%5C,%5C.:;%5D+/g,%22%22)+%22_%22+(new%20Date).getTime()+%22.png%22,t.click(),new%20Promise(function(e)%7BsetTimeout(10,e,t)%7D)%7D).then(function(e)%7B0===e.href.indexOf(%22blob:%22)&&(URL.revokeObjectURL(e.href),e.href=%22###%22)%7D).catch(function(e)%7Bconsole.error(e)

@JLChnToZ
JLChnToZ / global.d.ts
Last active June 6, 2018 11:57
Demo for workaround on writing tsx file without React but with Hyperscript.
declare module '__globals' {
type DomElement = Element;
type DeepPartial<T> = {
[K in keyof T]?: T[K] | DeepPartial<T[K]>;
};
type FreePartialProperties<T> = {
[K in keyof T]: DeepPartial<T[K]> & {
[key: string]: any;
};
};
@JLChnToZ
JLChnToZ / syncgif.js
Created January 14, 2018 14:16
A little script for refreshing all gifs on a webpage to make them synchronized.
(function refreshGif(selector, images, srcs) {
var mode = !!srcs, i;
if(mode) {
for(i = 0; i < images.length; i++)
images[i].src = srcs[i];
return;
}
var dummyGif = 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';
images = document.querySelectorAll((selector || '') + ' img[src$=\'.gif\']');
srcs = [];
@JLChnToZ
JLChnToZ / ninjectscript.js
Last active December 7, 2017 16:31
Inject external JavaScript like a ninja
var ninjectScript = (function(window, document) {
var head = document.head || document.getElementsByTagName('head')[0],
BlobBuilder,
builderPrefixes = [
'webkit', 'Webkit', 'WebKit',
'moz', 'Moz', 'o', 'O',
'ms', 'Ms', 'MS',
'khtml', 'Khtml', ''
];