Skip to content

Instantly share code, notes, and snippets.

View codehz's full-sized avatar
🔮

Neko Hz codehz

🔮
View GitHub Profile
@codehz
codehz / installation.md
Last active September 22, 2019 23:22
StoneServer

codehz/StoneServer
codehz/stoneserver
You can find docker-compose.yml file in the github repo.

This tutorial is written for user that don't want to use Docker (or Archlinux).

Prerequirement

git cmake make or ninja jq curl redis-server

Minecraft 1.9.0.15 x86 apk

@codehz
codehz / inst.sh
Last active February 6, 2019 10:53
run StoneServer w/o docker
#!/bin/bash -e
printf "%s\n" "Clean up..."
rm -rf output
printf "%s\n" "Downloading..."
wget -q --show-progress -O stone.zip https://gitlab.com/codehz/StoneServer/builds/artifacts/master/download?job=job_package
printf "%s\n" "Unziping..."
unzip stone.zip > /dev/null
(cd output; tar cBf - . | (cd ..; tar xBf -))
rm -rf output
mkdir -p data
@codehz
codehz / bdsm-system.service
Last active January 28, 2021 03:23
Get BDSM (Bedrock Dedicated Server Manager) (Used for testing)
[Unit]
Description=Bedrock Dedicated Server Manager
Documentation=https://github.com/bdsm-technology/BDSM
After=network.target
[Service]
User=user
Group=user
WorkingDirectory=/path/to/mcpe
ExecStart=/path/to/mcpe/bdsm daemon -profile %i
@codehz
codehz / make_callback_x86_64_linux_gnu.cpp
Last active September 17, 2018 03:08
Function object to function pointer
#include <functional>
#include <sys/mman.h>
#include <boost/callable_traits/function_type.hpp>
template <typename T> struct FunctionWrapper;
template <typename R, typename... PS> struct FunctionWrapper<R(PS...)> {
short mov_r10 = 0xba49;
std::function<R(PS...)> *func;
short mov_rax = 0xb848;
@codehz
codehz / style.less
Created April 1, 2018 09:12
Atom-blur
html,
atom-workspace,
atom-workspace-axis,
status-bar,
atom-panel-container,
atom-pane-container,
atom-pane-axis,
atom-pane > *,
atom-dock,
atom-dock > *,
@codehz
codehz / main.go
Created December 24, 2017 14:38
Steam-Discount-Sticker
package main
import (
"bytes"
"fmt"
"github.com/chai2010/webp"
"github.com/fogleman/gg"
"github.com/satori/go.uuid"
"golang.org/x/image/font"
"golang.org/x/image/tiff"
@codehz
codehz / test.md
Last active December 10, 2017 02:40

test *test*

test **test**

test _test_

test __test__

@codehz
codehz / Zhihu_MathJax.js
Last active November 13, 2022 10:51
知乎公式渲染强制使用MathJax
This file has been truncated, but you can view the full file.
// ==UserScript==
// @name Zhihu MathJax
// @namespace http://tampermonkey.net/
// @version 0.3
// @description 知乎公式渲染强制使用MathJax,配合AdBlock拦截www.zhihu.com/equation较为合适(因为用脚本隐藏还是会进行网络请求。。。)(修改自 https://zhuanlan.zhihu.com/p/27551432 ,感谢 @梨梨喵 和 @帅气可爱魔理沙 ,假装可以艾特到)
// @author CodeHz
// @match http*://*.zhihu.com/*
// @grant GM_addStyle
// ==/UserScript==
// MathJax single file build. Licenses of its components apply
@codehz
codehz / simple_and_naivie_js_parser_combinator.js
Last active May 29, 2017 09:53
Simple ans naivie parser combinator for javascript
class Stream {
constructor(tokens) {
this.tokens = tokens
this.pos = 0
}
get next() {
return this.tokens[this.pos++] || ''
}
public class HelloWorld
{
public HelloWorld() {}
public static void main(String[] paramArrayOfString)
{
System.out.println(concat("233", 100));
}
public static String concat(String paramString, int paramInt) {