Skip to content

Instantly share code, notes, and snippets.

View MatteoJoliveau's full-sized avatar

Matteo Joliveau MatteoJoliveau

View GitHub Profile
@MatteoJoliveau
MatteoJoliveau / flake.nix
Created September 26, 2022 17:01
Nix shell for Tauri projects
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
@MatteoJoliveau
MatteoJoliveau / eu-vendors.md
Last active September 30, 2022 14:09
List of EU-based software vendors. Useful if you're starting a company and don't want to depend on US-based tech-giants

Online businesses rely on a number of third-party vendors that supply different kinds of services, from emails to storage and computing, analytics and more.

This document lists companies that offer different kinds of services. When selecting a vendor, the following criteria were evaluated in order of preference.

  • They are based and/or incorporated in the EU. As Europeans we feel EU companies have much to offer in the digital space. US-based tech giants have already enough market share.
  • They are privacy-friendly. We value privacy, and feel our vendors should as well.
  • They offer EU-based hardware infrastructure. This is important to simplify GDPR compliance and feeds into the previous point.
  • They provide high-quality services at competitive rates. Newborn businesses can't afford to burn a lot of cash on vendor subscriptions.

See https://european-alternatives.eu/ for more reasons to choose EU vendors.

@MatteoJoliveau
MatteoJoliveau / rbac.rs
Created May 4, 2020 08:21
Super simple Rust RBAC
use std::cmp::{PartialEq, Eq};
use std::collections::{HashMap, HashSet};
pub struct Model {
principals: HashMap<String, Principal>,
}
impl Model {
pub fn new(principals: Vec<Principal>) -> Self {
let mut map = HashMap::new();
extends Node
onready var player_a: AudioStreamPlayer = AudioStreamPlayer.new()
onready var player_b: AudioStreamPlayer = AudioStreamPlayer.new()
export (int) var cross_fade_speed: int = 100
var max_volume: float = 0
var silence_db: float = -80.0
var active_player: AudioStreamPlayer
{
"extends": ["airbnb-typescript/base"],
"plugins": ["@typescript-eslint", "jest"],
"parser": "@typescript-eslint/parser",
"rules": {
"import/prefer-default-export": "off",
"class-methods-use-this": "off"
},
"env": {
"jest": true
Resources:
HelloFunctionServiceRole186F1BA8:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Statement:
- Action: sts:AssumeRole
Effect: Allow
Principal:
Service: lambda.amazonaws.com
- echo: Hello Quicken!
- echo: "I'm on GitHub Gist!"
static string version = "v1.0.0";
IMyTextPanel screen_1;
IMyTextPanel screen_2;
List<IMyGasTank> oxygen_tanks = new List<IMyGasTank>();
List<IMyAirVent> air_vents = new List<IMyAirVent>();
static string screen_prefix = "Engineering Screen";
public Program()
@MatteoJoliveau
MatteoJoliveau / what.cr
Created June 22, 2018 12:23
A minimal POC to validate an IoC container in Crystal
abstract struct Any; end
record A(T) < Any, this : T
class What
def hello()
puts "Hello!"
end
end
container = {} of String => Any
@MatteoJoliveau
MatteoJoliveau / pageable_type.rb
Created June 21, 2018 07:30
Pageable interface to paginate with Kaminari in GraphQL Ruby
module Types
module PageableType
include Types::Base::Interface
field :current_page, Integer, null: true
field :previous_page, Integer, null: true, method: :prev_page
field :next_page, Integer, null: true
field :total_pages, Integer, null: true
field :total_items, Integer, null: true, method: :total_count
field :size, Integer, null: true, method: :count
field :first_page, Boolean, null: true, method: :first_page?