Skip to content

Instantly share code, notes, and snippets.

View alex179ohm's full-sized avatar
🎯
Focusing

Alessandro Cresto Miseroglio alex179ohm

🎯
Focusing
View GitHub Profile
@alex179ohm
alex179ohm / gist:f5947f4e0677e47dbe0d
Last active November 25, 2015 15:41 — forked from debasishg/gist:8172796
big data url list
  1. General Background and Overview
@alex179ohm
alex179ohm / gist:51c4e5724f84ac8c8689
Last active November 25, 2015 15:42 — forked from the42/gist:1956518
golang http gzip handler writer
package main
import (
"compress/gzip"
"io"
"net/http"
"strings"
)
type gzipResponseWriter struct {
@alex179ohm
alex179ohm / config.json
Created April 2, 2017 11:12 — forked from anonymous/config.json
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
@alex179ohm
alex179ohm / wttr_light_theme
Last active November 17, 2018 11:58
Wttr.in light theme readable on light terminal colors.
_wttr() {
curl -s wttr.in/$1 | sed -e 's/38;5/1;38;5/g' -e 's/226m/220m/g'
if [ $? -ne 0 ]
then
printf "\033[1;38;5;196Something go wrong.\033[0m\n"
return 1
fi
}
alias wttr='_wttr'
extern crate nsqueue;
extern crate actix;
use nsqueue::{Consumer, Connection, Ctx, Msg, Error, Cmd, fin, Config};
use actix::prelude::*;
struct MyReader;
impl Consumer<Ctx> for MyReader {
// on_message callback
extern crate nsqueue;
extern crate actix;
extern crate futures;
use actix::prelude::*;
use std::time::Duration;
use futures::future::Future;
use nsqueue::{Producer, Pub, Error, NsqValue};
struct MyClient ( Addr<Producer> );

Keybase proof

I hereby claim:

  • I am alex179ohm on github.
  • I am alex179ohm (https://keybase.io/alex179ohm) on keybase.
  • I have a public key ASCAwVjgrd4KYtV4xoAgz1gX-c-P4EuwOaO5ZR0Qipwe8Qo

To claim this, I am signing this object:

use std::collections::HashMap;
use actix::prelude::*;
use std::sync::mspc::channel;
use rand;
// we have a lot of resources to process (centinaia di migliaia di risorse per centinaia di migliaia di requests :))
const N_SESSIONS = 12;
#[derive(Message)]
@alex179ohm
alex179ohm / crc16.rs
Last active October 17, 2019 12:57
Redis hash function in Rust
/*
* Copyright 2001-2010 Georges Menie (www.menie.org)
* Copyright 2010-2012 Salvatore Sanfilippo (adapted to Redis coding style)
* Copyright 2019-2021 Alessandro Cresto Miseroglio (ported to Rust programming language)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
call plug#begin()
Plug 'tpope/vim-sensible'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'NLKNguyen/papercolor-theme'
Plug 'scrooloose/nerdtree'
Plug 'jiangmiao/auto-pairs'
Plug 'bling/vim-bufferline'
Plug 'othree/jspc.vim', { 'for': ['javascript', 'javascript.jsx'] }
Plug 'posva/vim-vue'