Skip to content

Instantly share code, notes, and snippets.

View SOF3's full-sized avatar
🚂
Watching the model train

Jonathan Chan Kwan Yin SOF3

🚂
Watching the model train
View GitHub Profile
RewriteRule "^/([A-Za-z0-9]([A-Za-z0-9\-]*[A-Za-z0-9\-])?)/([A-Za-z0-9_\-]+)(/([^\.]+))?\.(zip|tar|gz|phar|php|pmf)" /index.php?username=$1&repo=$3&version=$5&extension=$6
@SOF3
SOF3 / NeedleTree.java
Last active May 25, 2019 08:22
Java code to search haystack with a large amount of substrings efficiently
import java.util.HashMap;
import java.util.Map;
class NeedleTree{
private int codePoint;
private boolean selfSet = false;
private Map<Integer, NeedleTree> children = new HashMap<>();
public NeedleTree(int codePoint){
this.codePoint = codePoint;
@SOF3
SOF3 / run.php
Created September 25, 2016 16:38 — forked from shoghicp/run.php
Header Extractor - Usage: php run.php --input libminecraftpe.so --output headers/ --pointer-size 4 --asm
<?php
/**
* Minecraft: Pocket Edition header extractor
*
* This tool needs objdump (and objdump-multiarch + arm variants) installed on the current system
*
*/
const VERSION = "0.0.1";

For 4 people:

1,2;3,4
1,3;2,4
1,4;2,3

For 6 people:

1,2;3,4;5,6

1,3;2,5;4,6

<?php
class ReadStreamTask extends AsyncTask{
public function __construct(string $host, CommandSender $sender){ // Step 1
$this->host = $host;
parent::__construct($sender);
}
public function onRun(){
$socket = fsockopen($this->host); // Step 2
@SOF3
SOF3 / plugin.yml
Created November 12, 2016 14:42 — forked from PEMapModder/plugin.yml
ChatPopSound - Auto-generated gist plugin stub by pmt.mcpe.me InstaPlugin
---
name: ChatPopSound
author: PEMapModder
version: "1.0"
api:
- 1.12.0
main: PEMapModder\ChatPopSound\Main
commands: []
permissions: []
...

Keybase proof

I hereby claim:

  • I am sof3 on github.
  • I am sofe (https://keybase.io/sofe) on keybase.
  • I have a public key whose fingerprint is 2967 BB2A 20B3 A34D 3F9E B350 A037 9676 C4D9 D5D9

To claim this, I am signing this object:

6
7
8
9
10
11
12
13
14
15
<?php
class SendMessageTask extends AsyncTask{
public function __construct(PluginMain $mainClass, string $url){
parent::__construct($mainClass);
$this->url = $url;
}
public function onRun(){
$this->setResult(Utils::getURL($this->data));
}