^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$
- Semantic versioning http://semver.org/
- Source of the regex npm/node-semver#32
log-queries | |
log-facility=/var/log/dnsmasq.log | |
no-resolv | |
server=8.8.4.4 | |
server=8.8.8.8 | |
address=/router/10.1.1.1 | |
address=/server/10.1.1.2 |
^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$
#!/bin/bash | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1 |
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with https://brew.sh/
See https://github.com/comp500/fabric-serverside-mods for the latest mod list!
using UnityEngine; | |
using System.Collections; | |
public class CameraShake : MonoBehaviour | |
{ | |
// Transform of the camera to shake. Grabs the gameObject's transform | |
// if null. | |
public Transform camTransform; | |
// How long the object should shake for. |
String getBaseUrl(HttpServletRequest request) { | |
String baseUrl = request.getRequestURL().substring(0, request.getRequestURL().length() - request.getRequestURI().length()) + request.getContextPath(); | |
return baseUrl; | |
} |
<?php | |
# http://jeffreysambells.com/2012/10/25/human-readable-filesize-php | |
function human_filesize($bytes, $decimals = 2) { | |
$size = array('B','kB','MB','GB','TB','PB','EB','ZB','YB'); | |
$factor = floor((strlen($bytes) - 1) / 3); | |
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$size[$factor]; | |
} | |
echo human_filesize(filesize('example.zip')); |
Say you wanted to emit an explosion particle whenever your block is destroyed. Emitting particles requires access to the ParticleManager
, which only exists on the MinecraftClient
instance. Let's try doing that:
public class MyBlock extends Block {
@Override
public void onBlockRemoved(BlockState before, World world, BlockPos pos, BlockState after, boolean bool) {