Skip to content

Instantly share code, notes, and snippets.

View joaopaulovieira's full-sized avatar
🐢
I may be slow to respond.

João Paulo da Silva Vieira joaopaulovieira

🐢
I may be slow to respond.
  • Globo.com
  • Rio de Janeiro, Brazil
  • 02:12 (UTC -03:00)
  • X @tropical_dev
View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:mpeg:dash:schema:mpd:2011"
xmlns:xlink="http://www.w3.org/1999/xlink"
xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd"
profiles="urn:mpeg:dash:profile:isoff-live:2011"
type="dynamic"
minimumUpdatePeriod="PT3S"
suggestedPresentationDelay="PT3S"
availabilityStartTime="2017-10-04T03:31:48"
ffmpeg -hide_banner \
-re -f lavfi -i "testsrc2=size=1280x720:rate=30" -pix_fmt yuv420p \
-c:v libx264 -x264opts keyint=30:min-keyint=30:scenecut=-1 \
-tune zerolatency -profile:v high -preset veryfast -bf 0 -refs 3 \
-b:v 1400k -bufsize 1400k \
-hls_time 5 -hls_list_size 240 -hls_start_number_source epoch -f hls /tmp/stream.m3u8
docker run --rm -v /tmp:/opt/www -p 8080:8080 webratio/nodejs-http-server:0.9.0 http-server /opt/www -a :: -p 8080 --cors -c-1
http://localhost:8080/stream.m3u8 //access
ares-generate -t basic webos_debug
ares-package webos_debug
ares-setup-device
ares-novacom --device webos-lab --getkey
ares-install com.domain.app_0.0.1_all.ipk --device webos-lab
ares-inspect --device webos-lab --app com.domain.app
@joaopaulovieira
joaopaulovieira / decimal_to_roman.py
Created July 20, 2018 17:34
Convert decimals to roman algarism's.
def int_to_roman(num):
_values = [
1000000, 900000, 500000, 400000, 100000, 90000, 50000, 40000, 10000, 9000, 5000, 4000, 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]
_strings = [
'M', 'C', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', "M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"]
result = ""
decimal = num
export GREP_OPTIONS="--color=auto"
export GREP_COLOR="4;33"
export CLICOLOR="auto"
export CLICOLOR="1"
export LSCOLORS="ExFxCxDxBxegedabagacad"
# show git branch
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
export PS1="\[\033[00m\]\u@\h\[\033[01;33m\] \w \[\033[31m\]\$(parse_git_branch)\[\033[00m\]$\[\033[00m\] "
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/Users/joaopaulo.vieira/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="bullet-train"
@joaopaulovieira
joaopaulovieira / allow-pf.sh
Created March 14, 2018 14:43
Allow HTTP domain to use powerfull features
#For Mac OSX
open -a /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --args --user-data-dir=$HOME --unsafely-treat-insecure-origin-as-secure=http://domain.dev:8080
@joaopaulovieira
joaopaulovieira / smooth_scroll _with_jQuery.js
Created April 25, 2017 20:10
smooth scroll with jQuery for "a" tags which href pointing to id tags
$('a[href*="#"]:not([href="#"])').click(function() {
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
$('html, body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
[].forEach.call($$("*"),function(a){a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16)})
#!/usr/bin/python
import httplib, urllib, json
params = urllib.urlencode({'GLBID': '1001', 'uri': 'localhost:5008/static/feed.html', 'body': 'teste'})
conn = httplib.HTTPConnection("localhost:5008")
conn.request("POST", "/post/localhost:5008/static/feed.html", params)
response = conn.getresponse()
print response.status, response.reason