Skip to content

Instantly share code, notes, and snippets.

@rogeriolino
rogeriolino / rssproxy.php
Last active February 13, 2018 04:21
RSS proxy for prevent CORS error
<?php
$url = isset($_GET['url']) ? $_GET['url'] : '';
if (filter_var($url, FILTER_VALIDATE_URL) === false || strtolower(substr($url, 0, 4)) !== 'http') {
echo("URL inválida: $url");
exit();
}
$proxy = null; // "http://192.168.0.10:3128"
@rogeriolino
rogeriolino / arcgis4.4.js
Created October 23, 2017 17:14
Fixing arcgis4.4 hitTest error
/*
Workaround to fix error on arcgis4.4 view click
*/
// XXX: TypeError: Cannot read property 'position' of undefined
view.originalHitTest = view.hitTest;
view.hitTest = function (evt) {
try {
return view.originalHitTest(evt);
@rogeriolino
rogeriolino / video-scaler.sh
Last active January 27, 2018 13:40
Scale MP4 video to 320px using ffmpeg
#
# Video Scaler
# https://gist.github.com/rogeriolino/b2abcbbc0f7bd8ebc18b4cd0975f5a3b
#
# Place the MP4 files in the same video-scaler.sh script directory.
# Finished (done) files will placed in $FINISHED_DIR directory.
# New resized files will placed in $OUTPUT_DIR directory.
#
SCALE=320
OUTPUT_DIR=output
@rogeriolino
rogeriolino / docker-compose.yaml
Last active November 14, 2017 11:58
Novo SGA v2.0 docker-compose
version: '2'
services:
novosga:
image: novosga/novosga:latest
restart: always
depends_on:
- mysqldb
ports:
- "80:80"
@rogeriolino
rogeriolino / vetor-dashboard-install.md
Last active July 25, 2022 18:57
Instalação Vetor Dashboard

Vetor Dashboard

Módulo dashboard para Novo SGA

Requisitos

  • Novo SGA v1.3 até v1.5 (NÃO É COMPATÍVEL COM A v2.0)
  • Permisão de escrita no diretório modules
  • Extensão php-zip instalada
@rogeriolino
rogeriolino / rsstojson.php
Last active May 25, 2018 20:40
RSS to JSON
<?php
$url = isset($_GET['url']) ? $_GET['url'] : '';
if (filter_var($url, FILTER_VALIDATE_URL) === false || strtolower(substr($url, 0, 4)) !== 'http') {
echo("URL inválida: $url");
exit();
}
$proxy = null; // "http://192.168.0.10:3128"
@rogeriolino
rogeriolino / linux-zebra-printer-gc420t.sh
Last active February 19, 2020 10:31
Linux Zebra Printer Test
#!/bin/sh
cat zebra-label.txt|lp -d <printername> -o raw