Skip to content

Instantly share code, notes, and snippets.

View mildronize's full-sized avatar

Thada Wangthammang mildronize

View GitHub Profile
@mildronize
mildronize / Restart-AppServiceInstances.ps1
Created September 13, 2023 13:10
Restart-AppServiceInstances.ps1
Param(
[Parameter(Mandatory=$true)]
# ID for the Azure subscription containing the App Service
[string]$SubscriptionId,
[Parameter(Mandatory=$true)]
# Name of the App Service on which the restart should be performed
[string]$AppServiceName,
[Parameter(Mandatory=$false)]
# Seconds between each instance restart, defaults to 30
[int]$SecondsBetweenRestarts = 30
@mildronize
mildronize / index.ts
Created March 23, 2023 00:41 — forked from cpojer/index.ts
When using `vite-node` with http servers, any HMR update will crash the process because the port is in use. This code can be inserted at the top-level of your script to gracefully stop the previous server instance before starting the new one.
#!/usr/bin/env node_modules/.bin/vite-node --watch
// `vite-node` HMR handler for servers.
type TeardownCallback = () => Promise<void>;
type Listener = () => TeardownCallback;
declare global {
// eslint-disable-next-line no-var
var __HMR__: {
listeners: ReadonlyArray<Listener>;
@mildronize
mildronize / Setup SSH keys.md
Last active November 20, 2021 08:43 — forked from my-wrm/README.md
Setup SSH keys for use with GitHub/GitLab/BitBucket etc

Create a new repository, or reuse an existing one.

Generate a new SSH key:

ssh-keygen -t rsa -C "your_email@example.com"

Copy the contents of the file ~/.ssh/id_rsa.pub to your SSH keys in your GitHub account settings (https://github.com/settings/keys).

Test SSH key:

@mildronize
mildronize / secure-client.js
Created October 26, 2021 08:37 — forked from ceejbot/secure-client.js
A node https server/client pair that uses client certs to authorize clients.
#!/usr/bin/env node
var fs = require('fs'),
https = require('https');
// We pass our client key & cert to the http agent,
// which we then use to make the request.
var agentOptions = {
key: fs.readFileSync('client.key'),
cert: fs.readFileSync('client.crt'),
/*
* Legit auto pop by Noxturnix
* Version 0.3
*
* How to use:
* 1. Go to https://popcat.click/
* 2. Press F12
* 3. Go to "Console" tab
* 4. Ignore the warning. There's no such malicious codes in this script. You can try to understand the code if you want
* 5. Copy and paste this script
@mildronize
mildronize / GitCommitEmoji.md
Created July 6, 2018 05:09 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
@mildronize
mildronize / minimal-psuautosigned.sh
Created January 6, 2016 14:35 — forked from ChatchaiJ/minimal-psuautosigned.sh
Minimal PSU Autosigned Script
#!/bin/bash
USER="YOUR-PASSPORT-ID"
PASSWD="YOUR-PASSPORT-PASSWORD"
COOKIES="cookies.txt"
/usr/bin/curl \
--connect-timeout 10 \
--max-time 10 \
-s -k \
#Kata with Up1 - Agile Thailand 2014 @ Eng CU
#Sat 7 June 2014
class FizzBuzzFactory():
def crete(self):
rules = [FizzBuzzBangRule(), BuzzBangRule(), FizzBangRule(), FizzBuzzRule(),
BangRule, BuzzRule(),FizzRule(),NormalRule()]
return FizzBuzz(rules)
class FizzBuzz():