Skip to content

Instantly share code, notes, and snippets.

View mudream4869's full-sized avatar
📚
Mukyu Learning

神楽坂帕琪 mudream4869

📚
Mukyu Learning
View GitHub Profile
@mudream4869
mudream4869 / backup.yml
Last active April 17, 2022 09:41
Minecraft world backup script
#!/usr/bin/ansible-playbook
- hosts: localhost
vars:
git_repo_path: /home/minecraft/backup/season2
minecraft_worlds_paths:
- /home/minecraft/srv1.18/world
- /home/minecraft/srv1.18/world_nether
- /home/minecraft/srv1.18/world_the_end
@mudream4869
mudream4869 / CHANGELOG.md
Created March 2, 2022 04:04 — forked from juampynr/CHANGELOG.md
Sample CHANGELOG

Change Log

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

[Unreleased] - yyyy-mm-dd

Here we write upgrading notes for brands. It's a team effort to make them as

@mudream4869
mudream4869 / python-event-sleep.py
Created February 10, 2022 15:39
python-event-sleep.py
import threading, signal
exit = threading.Event()
def main():
while not exit.is_set():
exit.wait(60)
def quit(signo, frame):
exit.set()
@mudream4869
mudream4869 / python-sleep.py
Created February 10, 2022 15:23
interrupted sleep
import signal, time
class InterruptSleep(Exception):
pass
def main():
while True:
try:
time.sleep(60)
except InterruptSleep:
@mudream4869
mudream4869 / main.go
Created April 22, 2021 04:10
Fake quine with go embed
package main
import (
_ "embed"
)
//go:embed main.go
var s string
func main() {
@mudream4869
mudream4869 / llvm-helloworld.cpp
Created April 16, 2021 04:11
LLVM Helloworld
#include <llvm/IR/Function.h>
#include <llvm/IR/IRBuilder.h>
#include <llvm/IR/LLVMContext.h>
#include <llvm/IR/Module.h>
#include <llvm/IR/Value.h>
#include <llvm/Support/raw_os_ostream.h>
#include <memory>
@mudream4869
mudream4869 / intbuffv4.cpp
Created March 19, 2020 14:27
intbuffv4.cpp
#include <algorithm>
#include <cstdio>
#include <memory>
class IntBuff {
public:
IntBuff() = default;
explicit IntBuff(size_t sz) : sz(sz) {
if (sz) {
arr = std::unique_ptr<int[]>(new int[sz]);
@mudream4869
mudream4869 / intbuffv3.cpp
Created March 18, 2020 06:40
intbuffv3.cpp
#include <algorithm>
#include <cstdio>
#include <memory>
class IntBuff {
public:
IntBuff() = default;
explicit IntBuff(size_t sz) : sz(sz) {
if (sz) {
arr = new int[sz];
@mudream4869
mudream4869 / intbuffv2.cpp
Created March 15, 2020 07:51
intbuffv2.cpp
#include <algorithm>
#include <cstdio>
#include <memory>
class IntBuff {
public:
IntBuff() = default;
explicit IntBuff(size_t sz) : sz(sz) {
if (sz) {
arr = new int[sz];
@mudream4869
mudream4869 / intbuffv1.cpp
Last active March 15, 2020 07:00
intbuffv1.cpp
#include <cstdio>
class IntBuff {
public:
IntBuff() = default;
explicit IntBuff(size_t sz) : sz(sz) {
if (sz) {
arr = new int[sz];
}
};