Skip to content

Instantly share code, notes, and snippets.

View mavimo's full-sized avatar
⌨️
coding

Marco Vito Moscaritolo mavimo

⌨️
coding
View GitHub Profile
<?php
class FileContentCounter
{
private $file;
public function __construct($file)
{
$this->file = $file;
}
@mavimo
mavimo / Car.php
Last active April 4, 2016 12:24
Codemaster day2
<?php
namespace Codemaster\Example\Day2;
use Codemaster\Example\Day2\EngineInterface;
class Car
{
private $engine;
private $wheels;

In babun eseguire:

pact install php-phar php-json php-iconv php-posix php-tokenizer php-mbstring php-zlib php-ctype php-simplexml

Evitare il file:

/etc/php5/php.ini

cercare

@mavimo
mavimo / Animale.php
Last active April 4, 2016 14:53
Esercizio ZOO
<?php
namespace Codemaster\Esercizio2;
use Codemaster\Esercizio2\AnimaleInterface;
abstract class Animale implements AnimaleInterface
{
private $carne;
@mavimo
mavimo / basic-auth.js
Last active May 19, 2016 09:36
esempi-basic-auth
// jQuery
$.ajax({
url: 'https://api.plannify.com/v1/auth/search',
data: {
'txtSearch': 'concerto',
'lat': 45.444101499999995,
'lng': 9.2077104,
'distance': 15
},
type: 'GET',
@mavimo
mavimo / italy-province.json
Last active November 20, 2016 16:14
italy-province.json
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mavimo
mavimo / docker-compose.yml
Last active September 29, 2017 16:48
Traefik multiple rule bug
version: '3'
services:
traefik:
image: traefik:1.4.0-rc3
ports:
- 80:80
- 8080:8080
volumes:
- ./traefik-work.toml:/etc/traefik/traefik.toml
@mavimo
mavimo / index.js
Last active December 6, 2017 08:52
Delete author github comments on PR
const AUTHOR_NAME = 'mavimo';
Array.prototype.forEach.call(document.querySelectorAll('.review-comment'), function (el, i) {
if (el.querySelector('.author').innerHTML == AUTHOR_NAME && el.querySelector('p sub') !== null && el.querySelector('p sub').innerHTML.startsWith('reported by')) {
el.querySelector('.js-comment-delete button').removeAttribute('data-confirm');
el.querySelector('.js-comment-delete button').click();
}
});
<link href=”https://YOUR_SITE/sites/default/files/css/css_Im0fVjX_Bf9K0gv9TRIdLqdmQqYcn36DNoGJMZcEt8w.css" type=”text/css” rel=”stylesheet” media=”all” />
<link href=”https://YOUR_SITE/sites/default/files/css/css_dRleluwuM8YsCCiN289fvI8am_PNta1qTn2E2aZ8iTM.css" type=”text/css” rel=”stylesheet” media=”all” />
<link href=”https://YOUR_SITE/sites/default/files/css/css__XYT6qARAADWfRmAVEkmu0eIHJgB9bV0eyx6bYZIeWk.css" type=”text/css” rel=”stylesheet” media=”all” />