Skip to content

Instantly share code, notes, and snippets.

@caillef
caillef / UIKit Particubes - caillef v0.2
Last active July 1, 2022 16:30
V0.1 of a simple UI Kit to place texts and icons in Particubes
-- UI KIT ----------------------------------
-- ADD IN YOUR ITEMS "caillef.empty"
-- (and if you try the example, you need to add "caillef.coin")
-- EXAMPLES AT THE END TO UNDERSTAND HOW TO USE THE UIKIT
-- V0.1 - SIMPLE TEXTS, ICONS and ANIMATIONS
-- 17 Apr. 2022
-- @caillef#4956 on Discord
@slonkazoid
slonkazoid / commands_in_particubes.lua
Last active November 4, 2021 17:01
Command parsing with arguments in Particubes
-- define your commands here
commands = {
help = {
description = "List all commands, or see one's description",
exec = function(cmd)
if cmd[2] ~= nil then -- if user supplied a command name
if commands[cmd[2]] ~= nil then -- and if that command exists
print(cmd[2] .. ": " .. commands[cmd[2]].description) -- print the command's description
else -- if it does not exist
print("Command not found: " .. cmd[2]) -- inform the user
@bweston92
bweston92 / indexes.go
Created September 4, 2018 14:17
MongoDB Golang Driver Ensure Index
package mgoutil
import (
"context"
"github.com/mongodb/mongo-go-driver/bson"
"github.com/mongodb/mongo-go-driver/mongo"
"github.com/pkg/errors"
)
@zwh8800
zwh8800 / datetime.lua
Last active August 30, 2024 12:16
lua ISO 8601 datetime parser - https://repl.it/IQuI/5
function parse_json_date(json_date)
local pattern = "(%d+)%-(%d+)%-(%d+)%a(%d+)%:(%d+)%:([%d%.]+)([Z%+%-])(%d?%d?)%:?(%d?%d?)"
local year, month, day, hour, minute,
seconds, offsetsign, offsethour, offsetmin = json_date:match(pattern)
local timestamp = os.time{year = year, month = month,
day = day, hour = hour, min = minute, sec = seconds}
local offset = 0
if offsetsign ~= 'Z' then
offset = tonumber(offsethour) * 60 + tonumber(offsetmin)
if xoffset == "-" then offset = offset * -1 end
@BretFisher
BretFisher / docker-swarm-ports.md
Last active August 12, 2024 16:10
Docker Swarm Port Requirements, both Swarm Mode 1.12+ and Swarm Classic, plus AWS Security Group Style Tables

Docker Swarm Mode Ports

Starting with 1.12 in July 2016, Docker Swarm Mode is a built-in solution with built-in key/value store. Easier to get started, and fewer ports to configure.

Inbound Traffic for Swarm Management

  • TCP port 2377 for cluster management & raft sync communications
  • TCP and UDP port 7946 for "control plane" gossip discovery communication between all nodes
  • UDP port 4789 for "data plane" VXLAN overlay network traffic
  • IP Protocol 50 (ESP) if you plan on using overlay network with the encryption option

AWS Security Group Example

@CanTheAlmighty
CanTheAlmighty / DisplayLink.swift
Last active March 10, 2024 08:43
DisplayLink for OSX
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active September 20, 2024 17:55
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S