Skip to content

Instantly share code, notes, and snippets.

View GabrieleRomeo's full-sized avatar

Gabriele Romeo GabrieleRomeo

View GitHub Profile
@ViktorovEugene
ViktorovEugene / mock_open.py
Last active July 4, 2021 11:55
mocking of builtins (python2/3)
"""
This is the example of mocking the builtin `open` function in python 2/3.
"""
from __future__ import print_function
import sys
import unittest
if sys.version_info.major == 3:
from unittest import mock
else:
@jesstelford
jesstelford / netflix-rpi.md
Last active April 4, 2020 17:52
Netflix on Raspberry Pi (incomplete)

Note: as @clibois mentioned below, due to the DRM Netflix uses, all decoding has to be done in CPU, making it somewhat choppy.

Note 2: Even the RPi 3 suffers from these CPU limitations. There is the potentially risky option of overclocking your RPi 3, but I haven't tried this.

If you manage to get smooth playback, please contact me, or post your solution here

UPDATE: I can no longer get this method to work. I have tried using Chromium v47, and v48, and both result in Netflix error "Oops, something went wrong" / C7053-1807, for which I can find no description online. If you manage to get things up and running, please contact me!

OSMC

@dearaujoj
dearaujoj / remove_git_tag
Created October 22, 2013 10:02
git remove tag locally and remote
git tag -d TagName && git push origin :refs/tags/TagName
if (!process.env.http_proxy) return;
var url = require('url');
var tunnel = require('tunnel');
var proxy = url.parse(process.env.http_proxy);
var tunnelingAgent = tunnel.httpsOverHttp({
proxy: {
host: proxy.hostname,
port: proxy.port
@neatshell
neatshell / myscript
Last active May 31, 2024 14:19
simple bash template that handles mandatory and optional arguments
#!/bin/bash
script="myscript"
#Declare the number of mandatory args
margs=2
# Common functions - BEGIN
function example {
echo -e "example: $script -m0 VAL -m1 VAL -o1 -o2 VAL"
}
@cobyism
cobyism / gh-pages-deploy.md
Last active June 26, 2024 23:06
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).