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
@SOF3
SOF3 / YieldTask.php
Last active May 17, 2023 23:30
Proof of concept for abusing yield as sleep
<?php
namespace SOFe\YieldTask;
use pocketmine\plugin\Plugin;
use pocketmine\scheduler\PluginTask;
class YieldTask extends PluginTask{
const UNIT_TICKS = 1;
const UNIT_SECONDS = 20;
const UNIT_MINUTES = 1200;
private $generator;
private $factor;
@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";

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:

@SOF3
SOF3 / dynec.rs
Last active February 5, 2022 14:11
fn main() {
let mut world = dynec::World::default();
world.schedule(run);
let farm = world.create::<Node>(
None,
dynec::component_initials![
@CROPS => Capacity(100),
@CROPS => Volume(50),
@SOF3
SOF3 / phar.php
Created December 12, 2021 13:16
My personal phar tool
#!/usr/bin/env php
<?php
//declare(strict_types=1);
const USAGE = /** @lang text */
<<<USAGE
Usage: phar <action> <phar file> ...
- stub : phar s <phar> [value]
set from file: sf <phar> <stub file>
- metadata : phar m <phar> [format: DUMP|Json|Yaml|Serialized|Export|Print]
rustup +nightly component add rust-src rust-analyzer-preview
echo "let g:ycm_rust_toolchain_root = '$HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu'" >> ~/.vimrc
@SOF3
SOF3 / git-mtime
Last active April 28, 2021 07:50
Update the mtime of all files in a git repository to the last commit time instead of checkout time
#!/usr/bin/env sh
# Update the mtime of all files in a git repository to the last commit time instead of checkout time
git ls-files | \
while read file; do
date="$(git log -1 --format="%cD" "$file")"
touch -d"$data" "$file"
done
@SOF3
SOF3 / GitHub Emoji List.md
Last active April 5, 2021 14:51 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
set itemSource nucleus1
ubind @poly
sensor items @unit @totalItems
jump 20 greaterThan items 0
sensor coreX itemSource @x
sensor coreY itemSource @y
ucontrol move coreX coreY 0 0 0
op rand itemId 12 b
jump 13 lessThan itemId 2
jump 15 lessThan itemId 5
# Parameters
set CURSOR_RATIO 2.5
set SCALE 80
set PAD_SIZE 0.1
set X_LEFT 8
set X_RIGHT 168
set BALL_RADIUS 0.05
set INIT_VELOCITY 0.08
set VELOCITY_INCREASE 0.02
set DIFFRACTION_RATIO 0.4