Skip to content

Instantly share code, notes, and snippets.

Rogério Lino rogeriolino

Block or report user

Report or block rogeriolino

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View rsstojson.php
<?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 / vetor-dashboard-install.md
Last active Jun 7, 2018
Instalação Vetor Dashboard
View vetor-dashboard-install.md

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 / docker-compose.yaml
Last active Nov 14, 2017
Novo SGA v2.0 docker-compose
View docker-compose.yaml
version: '2'
services:
novosga:
image: novosga/novosga:latest
restart: always
depends_on:
- mysqldb
ports:
- "80:80"
@rogeriolino
rogeriolino / video-scaler.sh
Last active Jan 27, 2018
Scale MP4 video to 320px using ffmpeg
View video-scaler.sh
#
# 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 / arcgis4.4.js
Created Oct 23, 2017
Fixing arcgis4.4 hitTest error
View arcgis4.4.js
/*
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 / rssproxy.php
Last active Feb 13, 2018
RSS proxy for prevent CORS error
View rssproxy.php
<?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"
View novosga.conf
server {
listen 80;
root /var/www/novosga/;
index index.php index.html index.htm;
server_name localhost;
location / {
try_files $uri $uri/ /public/index.php?$query_string;
@rogeriolino
rogeriolino / painelweb-temas.md
Last active Jan 28, 2016
Instalação de tema no Painel-Web
View painelweb-temas.md

Instalação de tema no Painel-Web

Antes de começar é necessário que tenha o Painel-Web instalado e funcionando corretamente.

O Tema

Extrair os arquivos do tema dentro da pasta "themes" do Painel-Web. Depois abra as Configurações do Painel e no campo "Tema" preencha com o nome da pasta do tema dentro da pasta themes (a pasta que acabou de criar).

Ex:

View novosga-utf8-fix.sql
-- fixUtf8 function required https://gist.github.com/rogeriolino/22d911fbe25538838bb3
-- IMPORTANT: don't run more than 1 time!
UPDATE unidades SET nome = fixUtf8(nome);
UPDATE prioridades SET nome = fixUtf8(nome), descricao = fixUtf8(descricao);
UPDATE grupos SET nome = fixUtf8(nome), descricao = fixUtf8(descricao);
UPDATE cargos SET nome = fixUtf8(nome), descricao = fixUtf8(descricao);
UPDATE locais SET nome = fixUtf8(nome);
UPDATE atendimentos SET nm_cli = fixUtf8(nm_cli), ident_cli = fixUtf8(ident_cli);
UPDATE historico_atendimentos SET nm_cli = fixUtf8(nm_cli), ident_cli = fixUtf8(ident_cli);
View mysql-fix-utf8.sql
CREATE FUNCTION fixUtf8(str VARCHAR(255)) RETURNS VARCHAR(255)
RETURN CONVERT(CAST(CONVERT(str USING latin1) AS BINARY) USING utf8);
You can’t perform that action at this time.