Skip to content

Instantly share code, notes, and snippets.

View siscia's full-sized avatar

Simone Mosciatti siscia

View GitHub Profile

User authentication system

Your task is now to create a user authentication system.

This document will guide you through all the features and implication of such system, so that you don't have to search them yourself.

We will focus on web/browser-technologies, however similar concept can be widely applied. This guide, is a work in progress, feel free to comment and provide feedbacks.

Expected Workflows

@siscia
siscia / split_slice.go
Last active September 18, 2023 08:17
Splitting a go array or slice in a defined number of chunks.
package foo
// SplitSlice splits a slice in `numberOfChunks` slices.
//
// Each slice is, at most, one element bigger than any other slice.
// Abs( len(result[i]) - len(result[j]) ) <= 1 for every i, j in the result.
//
// Moreover the function maintains the order of the elements, it is stable.
//
// If the input array is nil, or empty, the function returns nil.
import facebook
import time
import datetime
from StringIO import StringIO
from tempfile import NamedTemporaryFile
from urllib2 import urlopen, HTTPError
def simple_request(path):
"""Fetches the given path in the Graph API.
@siscia
siscia / json-objectid.md
Created August 28, 2014 16:57
json-objectid
layout title description category tags
post
Manage (Mongodb's) ObjectId and json
clojure
mongo
mongodb
rest
REST

I was writing yet another REST interface in Clojure + MongoDB (this is the last time) and if you have ever mixed this technology there is a little issues that raise every single time.

@siscia
siscia / # binutils - 2020-08-13_10-32-03.txt
Created August 13, 2020 08:50
binutils on Ubuntu 18.04.5 LTS - Homebrew build logs
Homebrew build logs for binutils on Ubuntu 18.04.5 LTS
Build date: 2020-08-13 10:32:03
@siscia
siscia / main.go
Created March 31, 2020 19:41
go parallel quick sort
package main
import (
"fmt"
"math/rand"
"sort"
"sync"
"time"
)
set -x
set -e
sudo apt install -y \
wget \
tar \
build-essential \
pkg-config \
libssl-dev \
bzip2 \
@siscia
siscia / DUCC_filesystem_structure.md
Last active January 13, 2020 17:50
A filesystem structure to serve container from local storage

DUCC filesystem structure

The DUCC filesystem structure is developed inside CERN to allow the efficient distribution of containers images. The structure itself is orthogonal to the filesystem implementation, but it was designed to work effiecientely with CernVM-FS.

Why formalize it

o) Naming o) Having a common understading of the benefits

==9674== Memcheck, a memory error detector
==9674== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==9674== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==9674== Command: redis-server --loadmodule target/debug/libredis_sql.so
==9674==
9674:C 14 Aug 2019 15:56:45.162 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
9674:C 14 Aug 2019 15:56:45.176 # Redis version=5.0.3, bits=64, commit=00000000, modified=0, pid=9674, just started
9674:C 14 Aug 2019 15:56:45.176 # Configuration loaded
9674:M 14 Aug 2019 15:56:45.201 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
9674:M 14 Aug 2019 15:56:45.204 # Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
Copyright <YEAR> <COPYRIGHT HOLDER>
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 furnished to do so, subject to the following conditions:
1. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
2. The telemetrics functionality must not be disable nor removed nor impared in any way.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CO