Skip to content

Instantly share code, notes, and snippets.

@TylerTemp
TylerTemp / violentmonkey.js
Created July 16, 2026 13:59
Unity Asset Store CDN Fix
// ==UserScript==
// @name Unity Asset Store CDN Fix
// @namespace local.assetstore.cdnfix
// @version 1.0.1
// @description Rewrite Unity Asset Store China CDN URLs to global CDN
// @match https://assetstore.unity.com/*
// @run-at document-start
// @grant none
// ==/UserScript==
@TylerTemp
TylerTemp / ExtBaseInspector.cs
Last active January 15, 2024 09:12
ExtNaughtyAttributes
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using DG.DOTweenEditor;
using DG.Tweening;
using Groobo;
using Groobo.Util;
using Groobo.Util.ExtInspector;
using NaughtyAttributes;
# modified from https://github.com/ohmyzsh/ohmyzsh/blob/master/themes/maran.zsh-theme
# add root color changing
# usage: curl https://gist.githubusercontent.com/TylerTemp/054b7b55aec723b104076a1c6d816f49/raw/5dcfba1e204a3d6766f6cdeb08e7fe4bd4847ba9/smaran.zsh-theme > ~/.oh-my-zsh/themes/smaran.zsh-theme
# then change your theme to smaran
########################################
# Theme with full path names and hostname
# Handy if you work on different servers all the time;
// from: https://gist.github.com/StigOlavsen/c75c78df4e704aeb5f904b6c851748ff
// modified: changed to URP (name & ref change), changed the shader namespace
// changed: using instead: https://forum.unity.com/threads/water-shader-graph-transparency-and-shadows-universal-render-pipeline-order.748142/#post-5518747
Shader "Custom/AR Proxy"
{
Properties
{
_ShadowColor ("Shadow Color", Color) = (0.35,0.4,0.45,1.0)
@TylerTemp
TylerTemp / smaliinjector.py
Last active January 31, 2020 13:41
add Log.e for smail script, for android apk reverse engine debugging
"""
Usage:
smaliinjector [options] inject [<inject_smali_path>] [--exclude=<smali_path>]...
smaliinjector [options] inject [<smali_path>]... [--verbose | --loglevel=<loglevel>]
smaliinjector [options] restore [<restore_smali_path>]...
Options:
-e<smali_path>, --exclude=<smali_path>
exclude folders or files for `inject_smali_path`.
Only works with `inject [inject_smali_path]`
@TylerTemp
TylerTemp / adblogcatwatcher.py
Last active January 5, 2020 10:42
Watching android adb logcat change on a specific pacakge name
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Usage:
adblogcatwatcher <package_name> [options] [--filter-message-contains <string>]...
adblogcatwatcher pid <package_name>
adblogcatwatcher start <package_name>
Options:
--adb=<path> specific adb execuable path. [default: adb]
@TylerTemp
TylerTemp / video_to_webm_ogv.sh
Created April 6, 2018 14:33
Converting video to webm/ogv by ffmpeg. You need to install ffmpeg first like `apt-get install ffmpeg`
#!/usr/bin/env bash
#-*- coding: utf-8 -*-
set -e
source_file="$1"
# echo "$source_file"
format="$2"
echo 1 "$format"
@TylerTemp
TylerTemp / tt2srt.py
Created April 6, 2018 14:28
youtube timedtext.xml to srt (SubRip) format converter
"""
Usage: python tt2srt.py source.xml > output.srt
"""
import sys
from xml.dom.minidom import parse
def mseconds_to_time(mseconds):
s, ms = divmod(mseconds, 1000)
@TylerTemp
TylerTemp / openresty-ubuntu-install.sh
Last active May 19, 2017 02:44 — forked from alex-roman/openresty-ubuntu-install.sh
Easy install openresty (used and tested on Ubuntu 14.04, 15.10 and 16.04)
#!/bin/bash
apt-get -y update
apt-get -y install nginx-extras build-essential libpcre3-dev libssl-dev libgeoip-dev libpq-dev libxslt1-dev libgd2-xpm-dev
wget -c https://openresty.org/download/openresty-1.11.2.3.tar.gz
tar zxvf openresty-1.11.2.3.tar.gz
cd openresty-1.11.2.3
./configure \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
@TylerTemp
TylerTemp / browser-detection.js
Created March 15, 2017 06:01 — forked from tjefferson/browser-detection.js
get more precise Chinese browser information in google analytics
<script>
var browserName = "Other";
var ua = window.navigator.userAgent;
browserRegExp = {
Sogou : /SE\s2\.X|SogouMobileBrowser/,
Explorer2345 : /2345Explorer|2345chrome|Mb2345Browser/,
Liebao : /LBBROWSER/,
Wechat : /MicroMessenger/,
QQBrowser : /QQBrowser/,
Baidu : /BIDUBrowser|baidubrowser|BaiduHD/,