Skip to content

Instantly share code, notes, and snippets.

View calogxro's full-sized avatar

calogxro

View GitHub Profile

Side projects

Q&A Service (2022)

A service that exposes a REST API which allows to create, update, delete and retrieve answers as key-value pairs.

Tech: Go, REST, MongoDB, EventStoreDB, Docker, Kubernetes

Design Patterns: CQRS, Event Sourcing

package main
import (
"fmt"
"net/http"
"github.com/gorilla/mux"
"github.com/gorilla/sessions"
)
@calogxro
calogxro / caffeinated.html
Last active September 10, 2022 11:50
ToDo app to sample Caffeine backend (https://github.com/rehacktive/caffeine) - DEMO: http://3.72.37.48:8001/
<!--
# Caffeinated #
ToDo app made with Vue.js
to sample Caffeine backend (https://github.com/rehacktive/caffeine)
Created on Oct 24, 2021
by Calogero Miraglia (https://github.com/calogxro)
GitHub: https://gist.github.com/calogxro/6e601e07c2a937df4418d104fb717570
from cpuid import *
def _is_set(id, reg_idx, bit):
regs = cpuid(id)
if (1 << bit) & regs[reg_idx]:
return "Yes"
else:
return "--"
@calogxro
calogxro / mailpoet_helpers.php
Created May 20, 2017 17:03
MailPoet: subscribe and unsubscribe a list
<?php
function mailpoet_subscribe($list_ids = array()) {
$current_user = wp_get_current_user();
$helper_user = WYSIJA::get('user','helper');
$helper_user->addSubscriber([
'user' => [
'email' => $current_user->user_email,
'firstname' => $current_user->user_firstname,
'lastname' => $current_user->user_lastname
@calogxro
calogxro / gist:9a5798df11f1f5e4f08db028027fc79c
Last active January 6, 2017 02:05
js date today/yesterday
now = Date.now()
today = new Date(now)
today.toLocaleDateString("it-IT", {year:'numeric', month:'2-digit', day:'2-digit'})
yesterday = new Date(now)
yesterday.setDate(yesterday.getDate() - 1)
yesterday.toLocaleDateString("it-IT", {year:'numeric', month:'2-digit', day:'2-digit'})
@calogxro
calogxro / gist:5561cda7dd7cc380ee89
Last active November 28, 2022 11:22
Use a forked project
// http://stackoverflow.com/questions/13325158/contributing-to-open-source-bundles-from-vendor-directory
"repositories": [ {
"type": "vcs",
"url": "https://github.com/calog3r0/laravel-api-generator.git"
} ],
"require": {
// ...
"mitulgolakiya/laravel-api-generator": "dev-plural_option"
},