Skip to content

Instantly share code, notes, and snippets.

View MaurizioCasciano's full-sized avatar
👨‍💻
Turning Bits ON & OFF

Maurizio Casciano MaurizioCasciano

👨‍💻
Turning Bits ON & OFF
View GitHub Profile
@MaurizioCasciano
MaurizioCasciano / spotihosts
Created February 5, 2018 07:01
The hosts file entries to block Spotify audio ad servers.
127.0.0.1 media-match.com
127.0.0.1 adclick.g.doublecklick.net
127.0.0.1 www.googleadservices.com
127.0.0.1 open.spotify.com
127.0.0.1 pagead2.googlesyndication.com
127.0.0.1 desktop.spotify.com
127.0.0.1 googleads.g.doubleclick.net
127.0.0.1 pubads.g.doubleclick.net
127.0.0.1 audio2.spotify.com
127.0.0.1 www.omaze.com
@MaurizioCasciano
MaurizioCasciano / html5-video-play-file-blob.html
Created January 5, 2018 19:37 — forked from edin-m/html5-video-play-file-blob.html
HTML video play file blob object url
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<video></video>
<br/>
<input type="file" name="file" id="fileItem" onchange="onChange()" >
@MaurizioCasciano
MaurizioCasciano / postman-deb.sh
Created December 17, 2017 11:55 — forked from SanderTheDragon/postman-deb.sh
A shellscript to create a Postman .deb file, for simple installation on Debian-based Linux distro's. Also creates a .desktop file.
#!/bin/sh
versionMaj="1"
versionMin="0"
versionRev="1"
version="$versionMaj.$versionMin-$versionRev"
echo "Removing old Postman tarballs"
rm -f $(ls Postman*.tar.gz)
@MaurizioCasciano
MaurizioCasciano / DoughnutChart.java
Created October 30, 2017 07:23 — forked from jewelsea/DoughnutChart.java
Creating a Doughnut chart in JavaFX
import javafx.collections.ObservableList;
import javafx.geometry.Bounds;
import javafx.scene.Node;
import javafx.scene.chart.PieChart;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
public class DoughnutChart extends PieChart {
private final Circle innerCircle;
@MaurizioCasciano
MaurizioCasciano / adfly-skipper.user.js
Created October 25, 2017 09:21 — forked from janglapuk/adfly-skipper.user.js
GreaseMonkey/TamperMonkey script for automating adf.ly 'Skip' button
// ==UserScript==
// @name adf.ly Auto Skip Ad
// @namespace http://github.com/janglapuk
// @version 0.5
// @description Let you ignore the bunch of ads :] (simple and optimized rev)
// @author janglapuk
// @match http://adf.ly/*
// @require http://code.jquery.com/jquery-3.2.1.slim.min.js
// @require https://gist.githubusercontent.com/raw/2625891/waitForKeyElements.js
// @updateURL https://gist.github.com/janglapuk/790470741a39a0f2301b27d234e6a9cc/raw/adfly-skipper.user.js
@MaurizioCasciano
MaurizioCasciano / sql-mongo_comparison.md
Created September 26, 2017 06:42 — forked from aponxi/sql-mongo_comparison.md
MongoDb Cheat Sheets

SQL to MongoDB Mapping Chart

SQL to MongoDB Mapping Chart

In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of common questions about MongoDB.

Executables

The following table presents the MySQL/Oracle executables and the corresponding MongoDB executables.

# List unique values in a DataFrame column
pd.unique(df.column_name.ravel())
# Convert Series datatype to numeric, getting rid of any non-numeric values
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True)
# Grab DataFrame rows where column has certain values
valuelist = ['value1', 'value2', 'value3']
df = df[df.column.isin(valuelist)]
@MaurizioCasciano
MaurizioCasciano / BFSDFS.java
Created May 19, 2017 15:43 — forked from gennad/BFSDFS.java
Breadth-first search and depth-first search Java implementation
Class Main {
public void bfs()
{
// BFS uses Queue data structure
Queue queue = new LinkedList();
queue.add(this.rootNode);
printNode(this.rootNode);
rootNode.visited = true;
while(!queue.isEmpty()) {
Node node = (Node)queue.remove();
@MaurizioCasciano
MaurizioCasciano / .gitignore
Created May 13, 2017 12:40 — forked from teocomi/.gitignore
Gitignore for Unity projects
# =============== #
# Unity generated #
# =============== #
[Tt]emp/
[Oo]bj/
[Bb]uild
/[Bb]uilds/
/[Ll]ibrary/
sysinfo.txt
*.stackdump
@MaurizioCasciano
MaurizioCasciano / create-iso.sh
Created April 25, 2017 14:29 — forked from julianxhokaxhiu/create-iso.sh
Simple bash script to create a Bootable ISO from macOS Sierra Install Image from Mac App Store
#!/bin/bash
#
# Credits to fuckbecauseican5 from https://www.reddit.com/r/hackintosh/comments/4s561a/macos_sierra_16a238m_install_success_and_guide/
# Adapted to work with the official image available into Mac App Store
#
# Enjoy!
hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build