Skip to content

Instantly share code, notes, and snippets.

@Klerith
Klerith / flutter-instalaciones.md
Last active April 28, 2024 17:29
Instalaciones del curso de Flutter - Móvil de cero a experto
@platu
platu / ovs+vxlan+lxd-lab.md
Last active April 28, 2024 17:28
VXLAN lab based on OpenVSwitch and lxd containers

% VXLAN lab based on OpenVSwitch and LXD containers


Preamble

The very first idea when I started writing this lab was to illustrate the Virtual Extensible LAN (VXLAN) technology. Now that OpenVSwitch configuration is smoothely integrated in the Debian networking configuration files, this should have resulted in somewhat easy-to-read gist.

@AlexandraKapp
AlexandraKapp / osrm_docker_windows.md
Last active April 28, 2024 17:25
How to set up your own OSRM backend with Docker on Windows

How to set up your own OSRM backend with Docker on Windows

The OSRM docker quick start provides a great explanation on how to set up the container: https://hub.docker.com/r/osrm/osrm-backend/

Yet - for Docker on Windows minor changes were necessary for me (otherwise I'd get "File not found" or "Permission" errors).

This is how it worked for me:

1. Pull the image

class Character {
constructor(name, strength, agility, criticalStrikeChance, criticalStrikeBonus, dodge) {
this.name = name;
this.strength = strength;
this.agility = agility;
this.criticalStrikeChance = criticalStrikeChance;
this.criticalStrikeBonus = criticalStrikeBonus;
this.dodge = dodge;
this.health = 100; // Starting health
}
var Character = function(name, strength, agility, criticalStrikeChance, criticalStrikeBonus, dodge) {
this.name = name;
this.strength = strength;
this.agility = agility;
this.criticalStrikeChance = criticalStrikeChance;
this.criticalStrikeBonus = criticalStrikeBonus;
this.dodge = dodge;
this.health = 100; // Starting health
};
export function getDiffTimeBetweenCurrentDate (dateString = '', now = new Date()) {
const dayInMilliseconds = 86400000
if ([null, undefined, false, true].includes(dateString)) {
return dateString
}
const date = new Date(dateString)
const isInvalidDate = isNaN(date.getTime())
if (isInvalidDate) {
return dateString
@chranderson
chranderson / nvmCommands.js
Last active April 28, 2024 17:22
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
@JunkFood02
JunkFood02 / Motion.kt
Last active April 28, 2024 17:22
A music player demo made with Jetpack Compose animation APIs, including shared element transition, list animations, animated content, etc.
package com.example.compose_debug
import androidx.compose.animation.EnterTransition
import androidx.compose.animation.ExitTransition
import androidx.compose.animation.core.CubicBezierEasing
import androidx.compose.animation.core.Easing
import androidx.compose.animation.core.FastOutLinearInEasing
import androidx.compose.animation.core.FastOutSlowInEasing
import androidx.compose.animation.core.LinearOutSlowInEasing
import androidx.compose.animation.core.PathEasing
@tuxity
tuxity / navicat_premium_reset_trial.sh
Last active April 28, 2024 17:21
Reset Navicat Premium 15/16 remaining trial days
#!/bin/bash
set -e
file=$(defaults read /Applications/Navicat\ Premium.app/Contents/Info.plist)
regex="CFBundleShortVersionString = \"([^\.]+)"
[[ $file =~ $regex ]]
version=${BASH_REMATCH[1]}
@carlin-q-scott
carlin-q-scott / ReferenceResolverWithNames.cs
Last active April 28, 2024 17:20
A JSON.Net IReferenceResolver that resolves field references using a Name property if available, otherwise it uses an index
using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json.Serialization;
namespace MyNewtonsoftExtensions
{
public class ReferenceResolverWithNames : IReferenceResolver
{
private readonly ReferenceCollection _collection = new ReferenceCollection();