Skip to content

Instantly share code, notes, and snippets.

@andrewpedia
andrewpedia / revprox.go
Created February 6, 2021 12:05 — forked from JalfResi/revprox.go
Simple reverse proxy in Go
package main
import(
"log"
"net/url"
"net/http"
"net/http/httputil"
)
func main() {
@andrewpedia
andrewpedia / revprox.go
Created February 6, 2021 12:05 — forked from thurt/revprox.go
Simple reverse proxy in Go (forked from original to use a struct instead of a closure)
package main
import(
"log"
"net/url"
"net/http"
"net/http/httputil"
)
func main() {
@andrewpedia
andrewpedia / gist:90c63452e3cb30595e5a9eaa05e2bd8f
Created February 12, 2021 05:18 — forked from eliben/gist:5797351
Generic regex-based lexer in Python
#-------------------------------------------------------------------------------
# lexer.py
#
# A generic regex-based Lexer/tokenizer tool.
# See the if __main__ section in the bottom for an example.
#
# Eli Bendersky ([email protected])
# This code is in the public domain
# Last modified: August 2010
#-------------------------------------------------------------------------------
@andrewpedia
andrewpedia / data_loading_utils.py
Created March 24, 2021 08:39 — forked from iyvinjose/data_loading_utils.py
Read large files line by line without loading entire file to memory. Supports files of GB size
def read_lines_from_file_as_data_chunks(file_name, chunk_size, callback, return_whole_chunk=False):
"""
read file line by line regardless of its size
:param file_name: absolute path of file to read
:param chunk_size: size of data to be read at at time
:param callback: callback method, prototype ----> def callback(data, eof, file_name)
:return:
"""
def read_in_chunks(file_obj, chunk_size=5000):
@andrewpedia
andrewpedia / aria2c_webUI.md
Created July 7, 2021 13:11 — forked from GAS85/aria2c_webUI.md
Aria2 + Ubuntu 18.04 + Apache2 + Web UI
OS: Ubuntu 18.04 Apache/2.4.18 1.0.2g-1ubuntu4.10
Aim: to install Aria2 with WebUI and secure Token.
IP Addr of your Aria2 server is 192.168.0.111
Your local IP network is 192.168.0.0/24

Aria 2

1. Installation

Install aria2 package:

@andrewpedia
andrewpedia / setup-theos-on-cygwin.sh
Created October 25, 2021 09:40 — forked from supermamon/setup-theos-on-cygwin.sh
Script to install theos on windows/cygwin
# Script is available at https://github.com/supermamon/install-theos
# Or if you trust me run
curl -LO https://git.io/install-theos && bash install-theos
@andrewpedia
andrewpedia / rust.md
Created November 29, 2021 12:42 — forked from niklasad1/rust.md
Rust, cargo commands

Expand macros

$ cargo rustc -- --pretty expanded -Z unstable-options

Emit asm

$ cargo rustc -- --emit asm && cat target/debug/deps/project_name-hash.s

Emit llvm-ir

$ cargo rustc -- --emit llvm-ir && cat target/debug/deps/project_name-hash.ll

Emit HIR

@andrewpedia
andrewpedia / FLASH_FULL_BASE.bat
Created February 13, 2022 09:13 — forked from zhuanyi/FLASH_FULL_BASE.bat
EMUI 9.1 Flasher Full Base Flashing Script
@echo off
echo *** WELCOME TO EMUI 9.1 Flasher by Vorion and Pretoriano80 ***
echo.
echo Thanks to @Ante0, @Atarii, @dkionline, @frantm, @lastfuckingdroid, @Mankindtw, @Pretoriano80, @shimp208, @zanooda123
echo ... and of course to [email protected]
echo.
pause
echo.
echo ******* PLEASE READ EVERYTHING THIS TOOLS TELLS YOU TO DO! *******

Disable Device Enrollment Notification on Mac.md

Restart the Mac in Recovery Mode by holding Comment-R during restart

Open Terminal in the recovery screen and type

csrutil disable
@andrewpedia
andrewpedia / common.cy
Created August 19, 2022 07:57 — forked from G5t4r/common.cy
A script for cycript
// 打印按钮的action及其target
function actionWithTargets(button) {
var allTargets = [button allTargets].allObjects();
if (!allTargets) {
return "is not a uicontrol"
}
var allShow = [];
for (var i = 0; i < allTargets.length; i++) {
var target = allTargets[i];
var actions = [button actionsForTarget: target forControlEvent: UIControlEventTouchUpInside];