Skip to content

Instantly share code, notes, and snippets.

View mtorromeo's full-sized avatar

Massimiliano Torromeo mtorromeo

View GitHub Profile
@mtorromeo
mtorromeo / artera-sms.php
Last active August 29, 2015 13:57
Esempio di invio SMS Artera
<?php
//open connection
$ch = curl_init("https://www.artera.it/invio_sms_post.php");
//POST data
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"mittente" => "Foo Srl",
"username" => "NOMEUTENTE",
"password" => "PASSWORD",
"operation" => "invioSMS",
@mtorromeo
mtorromeo / PKGBUILD
Created May 22, 2014 09:30
libuv 0.11.25 with inet_pton6.patch
# $Id: PKGBUILD 109507 2014-04-15 09:32:10Z mtorromeo $
# Maintainer: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
pkgname=libuv
pkgver=0.11.25
pkgrel=1
pkgdesc="A new platform layer for Node.JS"
arch=('i686' 'x86_64')
url="https://github.com/joyent/libuv"
license=('custom')
@mtorromeo
mtorromeo / parallelrun.py
Created June 5, 2014 08:33
Parallelize shell processes enforcing a concurrency limit using python3 and asyncio
import asyncio
concurrency_sem = asyncio.Semaphore(3)
@asyncio.coroutine
def run(process):
yield from concurrency_sem.acquire()
print("Running {}...".format(process))
proc = yield from asyncio.create_subprocess_shell(process)
yield from proc.communicate()
@mtorromeo
mtorromeo / gitlab-reimplement-room-setting.patch
Last active August 29, 2015 14:08
GitLab re-implement room setting
diff --git a/app/models/project_services/slack_service.rb b/app/models/project_services/slack_service.rb
index 963f544..6f235fd 100644
--- a/app/models/project_services/slack_service.rb
+++ b/app/models/project_services/slack_service.rb
@@ -13,8 +13,9 @@
#
class SlackService < Service
- prop_accessor :webhook
+ prop_accessor :webhook, :room
@mtorromeo
mtorromeo / add-firmware-to-debian.sh
Created June 8, 2016 13:28
Script to add firmware files to a debian ISO
#!/bin/bash
#
# add-firmware-to: Add non-free firmware to Debian install media
#
# Copyright (C) 2008-2009 dann frazier <dannf@debian.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or

Keybase proof

I hereby claim:

  • I am mtorromeo on github.
  • I am mtorromeo (https://keybase.io/mtorromeo) on keybase.
  • I have a public key ASC18I8Z1TeMbDsrKH3NFPKahRYquaiNneZ5aNakiEdhgAo

To claim this, I am signing this object:

@mtorromeo
mtorromeo / PKGBUILD
Last active August 3, 2017 12:52
Split passenger package
# $Id: PKGBUILD 247762 2017-08-03 10:17:52Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
pkgbase=passenger
pkgname=(passenger mod_passenger nginx-mod-passenger)
pkgver=5.1.7
pkgrel=2
_nginxver=1.12.1
pkgdesc="Fast and robust web server and application server for Ruby, Python and Node.js"
arch=('i686' 'x86_64')
@mtorromeo
mtorromeo / patternfly-mail.vue
Created November 16, 2017 18:09
Vue-Patternfly full table example
<template>
<div>
<pf-toolbar ref="toolbar" class="table-view-pf-toolbar"
:filters.sync="filters"
:filter-fields="filterFields"
:result-count="mails.total"
:columns="['Date', 'From', 'To', 'Subject', 'Size', 'Attachments']"
:picked-columns.sync="columns"
view="table"
@mtorromeo
mtorromeo / asgitowsgi.py
Last active November 12, 2021 11:42
Adapter to run an ASGI application in a WSGI server
import asyncio
import sys
from http import HTTPStatus
RESPONSE_STATUS_TEXT = {
code: str(code) for code in range(100, 600)
}
RESPONSE_STATUS_TEXT.update({
/*This code is automatically generated
*/pub mod endpoints { use super :: http :: * ; use super :: params :: * ;
# [ derive ( Debug , PartialEq , Clone ) ] enum CatFielddataUrlParams < 'a > { None , Fields ( Fields < 'a > ) , } impl < 'a > CatFielddataUrlParams < 'a > { pub fn url ( self ) -> UrlPath < 'a > { match self { CatFielddataUrlParams :: None => { UrlPath :: from ( "/_cat/fielddata" ) } CatFielddataUrlParams :: Fields ( ref fields ) => { let mut url = String :: with_capacity ( 16usize + fields . len ( ) ) ; url . push_str ( "/_cat/fielddata/" ) ; url . push_str ( fields . as_ref ( ) ) ; UrlPath :: from ( url ) } } } } # [ derive ( Debug , PartialEq , Clone ) ] # [ doc = "`Get: /_cat/fielddata`\n\n[Elasticsearch Documentation](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html)" ] pub struct CatFielddataRequest < 'a > { pub url : UrlPath < 'a > } impl < 'a > CatFielddataRequest < 'a > { # [ doc = "Request to: `/_cat/fielddata`" ] pub fn new ( ) -> Self { CatFielddataRe