Skip to content

Instantly share code, notes, and snippets.

View lmammino's full-sized avatar
🦁
Roar!

Luciano Mammino lmammino

🦁
Roar!
View GitHub Profile
@lmammino
lmammino / Cargo.toml
Last active February 22, 2022 19:37
Decode an EU DGC (greenpass) in Rust
[package]
name = "dgc-decode"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
base45 = "3.0.0"
ciborium = "0.2.0"
@mcollina
mcollina / tap-15.sh
Last active April 6, 2021 08:24
Remove all tap@15 deprecations
#!/bin/sh
find ./test -regex '.*js' | xargs sed -I '' 's/tearDown/teardown/g'
find ./test -regex '.*js' | xargs sed -I '' 's/strictEqual/equal/g'
find ./test -regex '.*js' | xargs sed -I '' 's/deepEqual/same/g'
find ./test -regex '.*js' | xargs sed -I '' 's/false(/notOk(/g'
find ./test -regex '.*js' | xargs sed -I '' 's/notStrictEqual/not/g'
find ./test -regex '.*js' | xargs sed -I '' 's/similar/match/g'
find ./test -regex '.*js' | xargs sed -I '' 's/strictDeepEqual/strictSame/g'
find ./test -regex '.*js' | xargs sed -I '' 's/is(/equal(/g'
find ./test -regex '.*js' | xargs sed -I '' 's/throw(/throws(/g'
@lmammino
lmammino / README.md
Last active May 16, 2020 19:08
Bummy Snake

Bummy snake

An incomplete Snake implementation using a Raspberry Pi 3, an adafruit st7735 screen and Python

Bummy Snake demo

:)

@em-shea
em-shea / template.yaml
Last active November 25, 2024 18:51
An example SAM template that creates a DynamoDB table, a Lambda function that writes to DynamoDB, and an EventBridge trigger
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: An app that includes a DynamoDB table, a Lambda function that writes to DynamoDB, and a scheduled EventBridge event
Resources:
LambdaWriteToDynamoDB:
# A function that writes to a DynamoDB table on a schedule
Type: 'AWS::Serverless::Function'
Properties:
FunctionName: LambdaWriteToDynamoDB
@lmammino
lmammino / LICENSE
Last active June 19, 2023 14:37
Decode Body of JWT tokens with bash
The `decode` function has been re-adapted from code provided by Moodstocks SAS and
therefore the following license applies to it:
Copyright (C) 2014 by Moodstocks SAS
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@lmammino
lmammino / README.md
Last active May 7, 2019 16:40
Compile and run rust programs

Allows to compile and run a Rust program under unix systems:

./rrun <rust_file_name> <runtime_arguments>

For instance:

./rrun args 1 2 3 4 5
@lmammino
lmammino / README.md
Created March 17, 2019 10:57
Pass arrays to shared libraries from python using C types

Pass arrays to shared libraries from python using C types

This example implements a simple shared library in C.

This library called libfifthy exposes a function called add_fifthy which takes an array of integers and modify it in place by adding 50 to all elements.

Then there's some code in python which builds an array and invokes the add_fifthy from the shared library and reads the altered array values.

Usage

@lmammino
lmammino / example.go
Last active October 8, 2024 11:51
Ldap filter beautifier
package main
import (
"fmt"
"./ldap"
)
var filter = "(&(&(&(& (mailnickname=*) (| (&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*))) )))(objectCategory=user)(department=IT)(physicalDeliveryOfficeName=Amsterdam)))"
func main() {
@eugenserbanescu
eugenserbanescu / svg-path
Created July 3, 2018 16:31
X-Y svg path mover
const PAIR_MATCHER = /([A-Z]?)([^A-Za-z,]+),(.*)/
function moveSvg(path, x=0, y=0) {
return path.split(' ').map(pair => {
const matches = pair.match(PAIR_MATCHER)
return matches === null ?
pair :
`${matches[1]}${parseFloat(matches[2]) + x},${parseFloat(matches[3]) + y}`
}).join(' ')
}
@crypticmind
crypticmind / README.md
Last active March 18, 2025 16:24
Setup lambda + API Gateway using localstack