Skip to content

Instantly share code, notes, and snippets.

View gubi's full-sized avatar

Alessandro Gubitosi gubi

View GitHub Profile
@gubi
gubi / fix_network_manager_ubuntu.txt
Created November 14, 2017 06:14 — forked from devcfgc/fix_network_manager_ubuntu.txt
fix network-manager ubuntu resolv.conf
http://askubuntu.com/questions/627899/nameserver-127-0-1-1-in-resolv-conf-wont-go-away
NetworkManager is the program which (via the resolvconf utility) inserts address 127.0.1.1 into resolv.conf. NM inserts that address if an only if it is configured to start an instance of the dnsmasq program to serve as a local forwarding nameserver. That dnsmasq instance listens for queries at address 127.0.1.1.
If you do not want to use a local forwarding nameserver then configure NetworkManager not to start a dnsmasq instance and not to insert that address. In /etc/NetworkManager/NetworkManager.conf comment out the line dns=dnsmasq
sudo nano /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile,ofono
<?php
$e = new Economics();
print_r($e->Property());
print_r($e->LabourTheory());
print_r($e->InvisibleHand());
?>
@gubi
gubi / README.md
Last active February 9, 2017 00:34

Node ARGV

@gubi
gubi / README.md
Last active February 9, 2017 00:32
Basic API routing with klein. For HTTP Status Codes see https://github.com/gubi/HTTP-Error-Codes

Basic API routing

PHP klein config for a basic API routing

@gubi
gubi / Plex Movie Scanner.py
Last active February 7, 2017 15:25
Plex Movie Scanner
#
# Copyright (c) 2010 Plex Development Team. All rights reserved.
#
import re, os, os.path
import Media, VideoFiles, Stack, Utils
SeriesScanner = __import__('Plex Series Scanner')
#nice_match = '(.+) [\(\[]([1-2][0-9]{3})[\)\]]'
nice_match = '(.+) [\(\[]([1-2][0-9]{3})[[\s].+[\)\]]'
standalone_tv_regexs = [ '(.*?)( \(([0-9]+)\))? - ([0-9])+x([0-9]+)(-[0-9]+[Xx]([0-9]+))? - (.*)' ]
<?php
/**
* Explode any single-dimensional array into a full blown tree structure,
* based on the delimiters found in it's keys.
*
* The following code block can be utilized by PEAR's Testing_DocTest
* <code>
* // Input //
* $key_files = array(
* "/etc/php5" => "/etc/php5",
@gubi
gubi / bootstrap-3_responsiveness.css
Created May 16, 2016 08:36
Bootstrap 3 Media Queries
/*==================================================
= Bootstrap 3 Media Queries =
==================================================*/
/*========== Mobile First Method ==========*/
/* Less than mobile (col-xs) */
@media only screen and (min-width: 0px){
}
<?php
interface PhilosophicalContexts {
/**
* The concept of Property
* @see http://www.iep.utm.edu/prop-con/
*/
public function Property();
}
interface PhilosophicalTheories extends PhilosophicalContexts {
/**
<?php
print PhysicsTheories::BohmTheory();
?>
<?php
abstract class Physics {
/**
* The Planck's law
* @param integer $J An integer that represent an energy measure
* @param integer $s An integer that represent a time measure
*/
public static function Planck($J, $s) {
$h = 6.62607004 * pow(10, -34) * ($J * $s);
return $h;