Skip to content

Instantly share code, notes, and snippets.

View favoyang's full-sized avatar

Favo Yang favoyang

View GitHub Profile
@MichaelCurrin
MichaelCurrin / README.md
Last active April 6, 2025 18:23
GitHub GraphQL - Get files in a repository

Get GitHub Files

Get the metadata and content of all files in a given GitHub repo using the GraphQL API

You might want to get a tree summary of files in a repo without downloading the repo, or maybe you want to lookup the contents of a file again without download the whole repo.

The approach here is to query data from GitHub using the Github V4 GraphQL API.

About the query

@thsbrown
thsbrown / P12Generator4AppleApps
Created March 31, 2020 16:23
Batch file to help easily create all the files needed to get apple app/game up and running without using a mac
echo off
cd c:\
cd c:\OpenSSL-Win32\bin
echo.
echo.
echo -----------------App P12 File Generator---------------
echo.
echo This batch file was made to help you easily create all
echo the files you need to get your apple app/game up and
@favoyang
favoyang / BuildAddressables.cs
Last active January 29, 2025 08:24
Build addressable bundles when clicking the build button
/// <summary>
/// The script gives you choice to whether to build addressable bundles when clicking the build button.
/// For custom build script, call PreExport method yourself.
/// For cloud build, put BuildAddressablesProcessor.PreExport as PreExport command.
/// Discussion: https://forum.unity.com/threads/how-to-trigger-build-player-content-when-build-unity-project.689602/
///
/// License: The MIT License https://opensource.org/licenses/MIT
/// </summary>
using UnityEditor;
using UnityEditor.AddressableAssets;
@NullArray
NullArray / extended-example.pac
Last active March 14, 2025 15:09
pac script example
// Simple PAC script example
function FindProxyForURL(url, host) {
if ( /*condition to pass the request through a local proxy server */ ) {
return 'PROXY 127.0.0.1:8080';
/* If you have Tor installed you can route this connection over Tor like so;*/
/* return 'PROXY 127.0.0.1:9050'; */
}
if ( /*condition to pass the request through a network proxy server */ ) {
@nkgokul
nkgokul / generate_toc_medium
Created January 21, 2019 19:54
Generate TOC for published medium articles
getTOCHtml();
function getTOCHtml() {
let TOCHtml = ""
$$("h2,h3,h4,h5").forEach(function(ele){
TOCHtml += `<a href='#${ele.id}'>${ele.innerText}</a><br/>` ;
//console.log(ele.innerText);
})
//console.log(TOCHtml);
var parentElement = $('.postArticle-content');
@chrisswanda
chrisswanda / WireGuard_Setup.txt
Last active May 8, 2025 19:21
Stupid simple setting up WireGuard - Server and multiple peers
Install WireGuard via whatever package manager you use. For me, I use apt.
$ sudo add-apt-repository ppa:wireguard/wireguard
$ sudo apt-get update
$ sudo apt-get install wireguard
MacOS
$ brew install wireguard-tools
Generate key your key pairs. The key pairs are just that, key pairs. They can be
@DavidKuennen
DavidKuennen / minimal-analytics-snippet.js
Last active March 17, 2025 06:52
Minimal Analytics Snippet
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
@lmj0011
lmj0011 / rejson-for-ubuntu.md
Last active November 4, 2024 10:18
Building and Loading the ReJSON v1 Module on Linux Ubuntu 16.04 for Redis

make sure you have at least redis v4.0+

redis-server --version

redis-cli --version

install the build-essential package

apt-get install build-essential

@DavidWells
DavidWells / netlify.toml
Last active May 15, 2025 18:44
All Netlify.toml & yml values
[Settings]
ID = "Your_Site_ID"
# Settings in the [build] context are global and are applied to all contexts unless otherwise overridden by more specific contexts.
[build]
# This is the directory to change to before starting a build.
base = "project/"
# NOTE: This is where we will look for package.json/.nvmrc/etc, not root.
# This is the directory that you are publishing from (relative to root of your repo)
@sokuhatiku
sokuhatiku / config.yaml
Last active May 20, 2025 06:08
Verdaccio for Unitypackage
#
# This is the default config file. It allows all users to do anything,
# so don't use it on production systems.
#
# Look here for more config file examples:
# https://github.com/verdaccio/verdaccio/tree/master/conf
#
# path to a directory with all packages
storage: ./storage