Skip to content

Instantly share code, notes, and snippets.

@dadodasyra
dadodasyra / PM5_World_converter.php
Created November 5, 2023 19:24
Convert world with plugin code to leveldb (can be used with sort of a TestCommand) it freezes the server until the end of the conversion and automatically detect the base format.
<?php
$originalPath = "/root/servers/miscs/converting/lobby";
$backupPath = "/root/servers/miscs/converting/backup"; //this will create a folder under this one with the name of the world
$providerManager = new WorldProviderManager();
$writableFormats = array_filter($providerManager->getAvailableProviders(), fn(WorldProviderManagerEntry $class) => $class instanceof WritableWorldProviderManagerEntry);
$requiredOpts = [
"world" => "path to the input world for conversion",
"backup" => "path to back up the original files",
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device, initial-scale=1.0">
<title>Rose🌹</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
@minimalefforttech
minimalefforttech / async_callable.py
Last active March 28, 2024 21:46
A simple example of running code on separate threads
# Copyright (C) 2024 Alex Telford
# http://minimaleffort.tech
# This work is licensed under the Creative Commons Attribution 4.0 International License.
# To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or send a letter to Creative Commons,
# PO Box 1866, Mountain View, CA 94042, USA.
# Distributed without any warranty or liability, use at your own risk
# This is an example of deffering code using Qt event loops
try:
from PySide6 import QtCore, QtWidgets
@miguelmota
miguelmota / README.md
Last active March 28, 2024 21:46
Arch linux secure machine

Create new user

sudo useradd -m -s /bin/bash alice
sudo passwd alice

Add user to wheel (sudo) group

@phil-blain
phil-blain / .gitattributes
Last active March 28, 2024 21:37
Git pickaxe : show only relevant hunks (filter displayed hunks using the given search string)
*.md diff=markdown
@0xjac
0xjac / private_fork.md
Last active March 28, 2024 21:36
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@OrionReed
OrionReed / DOM3D.js
Last active March 28, 2024 21:34
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // Β―\\_(ツ)_/Β―
@rxaviers
rxaviers / gist:7360908
Last active March 28, 2024 21:34
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:
@vdite
vdite / notify-on-new-post.php
Last active March 28, 2024 21:33
Send an email notification to the Wordpress administrator when a new post is published.
<?php
/**
Plugin Name: Alert Admin on new Post
Plugin URI: http://wordpress.stackexchange.com/questions/19040/alert-email-when-any-post-or-page-is-changed
Description: Send an email notification to the administrator when a new post is published.
Author: TheDeadMedic, transfered by Viktor Dite
Version: 1.0
Copyright CC share alike
* @param string $new_status
#!/usr/bin/python
# redict - redis based dictionary
# this version uses UserDict and a mostly cached redis data for low I/O impact
# almost always consistent dict. to make sure you have all latest data run __sync() periodically
# gleicon 2010 - http://zenmachine.wordpress.com - http://github.com/gleicon - http://7co.cc
import redis
from UserDict import UserDict
import time