Skip to content

Instantly share code, notes, and snippets.

View favoyang's full-sized avatar

Favo Yang favoyang

View GitHub Profile
set remindersOpen to application "Reminders" is running
set todoistToken to "<YOUR_TOKEN_HERE>"
set apiCall to "curl https://api.todoist.com/sync/v9/quick/add"
set listOfCommands to {}
tell application "Reminders"
@noobnooc
noobnooc / cloudflare-worker-proxy.js
Last active April 15, 2025 22:43
cloudflare-worker-proxy
// Website you intended to retrieve for users.
const upstream = 'api.openai.com'
// Custom pathname for the upstream website.
const upstream_path = '/'
// Website you intended to retrieve for users using mobile devices.
const upstream_mobile = upstream
// Countries and regions where you wish to suspend your service.
@marcospgp
marcospgp / SafeTask.cs
Last active October 7, 2024 12:47
Cancel async tasks in Unity upon exiting play mode
using System;
using System.Threading;
using System.Threading.Tasks;
using UnityEngine;
namespace UnityUtilities
{
/// <summary>
/// A replacement for `Task.Run()` that cancels tasks when entering or
/// exiting play mode in the Unity editor (which doesn't happen by default).
# [CONFIGURATION]
# Ensure WSL2 container is started and SSH is running
wsl sudo /etc/init.d/ssh start
# Ports to be forwarded
$ports = @(22) + @(6543,6544) + @(6800..6810);
# Change $addr to restrict connections to a particular interface IP
$listen_addr = '0.0.0.0';
@Frenchcooc
Frenchcooc / Sparkline.vue
Last active May 31, 2023 16:29
Simple sparkline component for Vue.js
<template>
<svg class="sparkline" :width="width" :height="height" :stroke-width="stroke">
<path class="sparkline--line" :d="shape" fill="none"></path>
<path
class="sparkline--fill"
:d="[shape, fillEndPath].join(' ')"
stroke="none"
></path>
</svg>
</template>
@mikerochip
mikerochip / MikesAddressablesTrainingManual.md
Last active May 23, 2021 17:16
Mike's Addressables Training Manual
@mob-sakai
mob-sakai / _README.md
Last active April 26, 2025 15:26
Run shell script on gist

Run shell script on gist

Shells that support process substitution such as bash and zsh allow to run shell script on gist as follows.

# With curl:
bash <(curl -sL ${GIST_URL}) args...

# With wget:
@claus
claus / example.js
Last active April 21, 2025 17:44
Proxy wrapper for tweenjs that automatically starts/stops requestAnimationFrame so you don't have to
import { tween } from './tween';
tween({ x: 0 })
.to({ x: 1 }, 200)
.onStart(() => { console.log('onStart') })
.onStop(() => { console.log('onStop') })
.onComplete(() => { console.log('onComplete') })
.onUpdate(tweenObj => { console.log('onUpdate', tweenObj.x) })
.start(1000)
@BatteryAcid
BatteryAcid / lambdaClientService.js
Last active October 26, 2021 14:28
Unity + Amazon GameLift setup in web console Part 2 snippets
// Example Lambda Client Service for Realtime Server example
// Original source: https://aws.amazon.com/blogs/gametech/creating-servers-for-multiplayer-mobile-games-with-amazon-gamelift/
// Contains @BatteryAcid's edits to accompany video Unity + Amazon GameLift setup in web console
// https://youtu.be/WaAZyqgkXDY
//const uuid = require('uuid');
const {"v4": uuidv4} = require('uuid');
const AWS = require('aws-sdk');
const GameLift = new AWS.GameLift({region: 'us-east-1'});
@vilicvane
vilicvane / wsl-host.ps1
Last active December 3, 2022 06:25
Access Windows host from WSL 2
# Access host ports from WSL 2.
# https://gist.github.com/vilic/0edcb3bec10339a3b633bc9305faa8b5
# Make sure WSL gets initialized.
bash.exe -c exit
# Record host name for /etc/hosts that points to host IP.
$HOST_NAME = "host.wsl";
# Ports listened on host localhost to forward, you don't need to add the port if it listens all addresses.