Skip to content

Instantly share code, notes, and snippets.

View galenzhao's full-sized avatar

Galen Zhao galenzhao

View GitHub Profile
@galenzhao
galenzhao / USER_AGENTS.js
Created December 28, 2021 03:16 — forked from DoveBoy/USER_AGENTS.js
backup
const USER_AGENTS = []
/**
* 生成随机数字
* @param {number} min 最小值(包含)
* @param {number} max 最大值(不包含)
*/
function randomNumber(min = 0, max = 100) {
return Math.min(Math.floor(min + Math.random() * (max - min)), max);
}
@galenzhao
galenzhao / PIDController.lua
Created November 30, 2020 10:00 — forked from DarkMorford/PIDController.lua
PID controller for Lua/ComputerCraft
--[[
PID Controller for Lua
Ported from https://github.com/br3ttb/Arduino-PID-Library/
--]]
local function millis()
return os.clock() * 1000
end
@galenzhao
galenzhao / gen_rsakey.sh
Last active January 26, 2019 13:09 — forked from lvjian700/gen_rsakey.sh
generate RSA keypair and cert for iOS using openssl
#!/usr/bin/env bash
echo $1
echo $2
echo $0
if [[ "$1" == "" && "$2" == "" ]]; then
echo NULL
exit 1
fi
#exit 0
mkdir "$1"
@galenzhao
galenzhao / json.lua
Created October 7, 2018 09:30 — forked from tylerneylon/json.lua
Pure Lua json library.
--[[ json.lua
A compact pure-Lua JSON library.
The main functions are: json.stringify, json.parse.
## json.stringify:
This expects the following to be true of any tables being encoded:
* They only have string or number keys. Number keys must be represented as
strings in json; this is part of the json spec.
@galenzhao
galenzhao / recursive_index.pl
Created August 4, 2017 05:03 — forked from Zverik/recursive_index.pl
Create index.html with a list of all files
#!/usr/bin/perl
# Create index.html with a list of all files.
# Written by Ilya Zverev, licensed WTFPL.
use strict;
use POSIX qw(strftime);
use HTML::Template;
use File::Basename;
use Getopt::Long;
#!/bin/bash
#
# This script was inspired by http://blog.diogot.com/blog/2013/09/18/static-libs-with-support-to-ios-5-and-arm64/
#
# This script uses a temporary folder for intermediate build products.
#
# Minimum deployment target is 5.0 for 32 bit architectures and for 64 bit architectures it is 7.0.
#
@galenzhao
galenzhao / resign.sh
Last active August 29, 2015 14:04 — forked from comuttun/resign.sh
#!/bin/bash -v
MYDIR=`pwd`
#MYDIR=$(cd $(dirname $0) && pwd)
IPA="$1"
PROVISION="$2"
CERTIFICATE="$3"
usage() {