Skip to content

Instantly share code, notes, and snippets.

View marttosc's full-sized avatar

Gustavo Marttos marttosc

View GitHub Profile
@marttosc
marttosc / ontology_example.owl
Created August 23, 2022 14:25
Ontology example
<?xml version="1.0"?>
<rdf:RDF xmlns="http://www.semanticweb.org/gustavo.pereira/ontologies/2022/7/untitled-ontology-3#"
xml:base="http://www.semanticweb.org/gustavo.pereira/ontologies/2022/7/untitled-ontology-3"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:swrl="http://www.w3.org/2003/11/swrl#"
xmlns:this="http://www.semanticweb.org/gustavo.pereira/ontologies/2022/7/untitled-ontology-3#"
@marttosc
marttosc / FizzBuzzConstructor.php
Created February 28, 2019 14:41
Fizz Buzz Test
<?php
class FizzBuzz
{
private $number;
public function __construct($number)
{
$this->number = $number;
}
@marttosc
marttosc / caesar_cipher.py
Created March 10, 2017 22:36
Caesar and Vigenère ciphers
MAX_KEY_SIZE = 26
def get_mode():
while True:
# Você quer criptografar ou decriptografar?
print('Wollen Sie zu verschlüsseln [v] oder zu entschlüsseln [e]?')
mode = input().lower()
@marttosc
marttosc / command.sql
Last active September 27, 2020 03:33
ODBC DBLink - Oracle and MySQL
CREATE DATABASE LINK "MYSQL_ORCL_LNK" CONNECT TO "USER_LNK" IDENTIFIED BY "PASSWD_LNK" USING 'MYSQLORACLE';
@marttosc
marttosc / event.js
Created August 24, 2016 18:49
Bootstrap modal: event close
$(document).on('hidden.bs.modal', '.modal', function () {
var player = $(this).find('.modal-content video');
player.pause();
});
@marttosc
marttosc / fix-qca6174.sh
Created August 11, 2016 16:53
Ubuntu 16.04 - Wifi problem with Qualcomm Atheros QCA6174 802.11ac
#!/bin/sh
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root!" 1>&2
exit 1
fi
cd /tmp
mkdir -p /lib/firmware/ath10k/QCA6174/hw3.0/
@marttosc
marttosc / filter.txt
Last active May 9, 2019 18:05
AdBlock Filters
@@*.dx.com/$document
@@http://*.wikipedia.org/$document
@@|http://download.cyanogenmod.org/|$document
@@|http://www.flaticon.com/|$document
@@|https://outlook.office365.com/owa/|$document
@@|https://play.google.com/music/listen|$document
@@||microsoftonline.com/$document
@@||cyanogenmod.org/$document
@@||app.evrdy.com/$document
@@||www.bradesco.com.br/$document
@marttosc
marttosc / script-oracle.sql
Last active June 14, 2016 21:19
MySQL DML - Locação
# Generated from SQLines
SELECT CLI.NOME,
(
CASE WHEN TPC.CODIGO = 1 THEN
SUM(VEI.VALORKM * (DEV.KMATUAL - VEI.KM) + (SELECT SUM(D.VALOR) FROM devolucao D WHERE D.LOCACAO = LOC.CODIGO)) ELSE
SUM(VEI.VALORDIARIA * DEV.DATAHORA- LOC.DATAHORA + (SELECT SUM(D.VALOR) FROM devolucao D WHERE D.LOCACAO = LOC.CODIGO))
END
) TOTAL
FROM cliente CLI, locacao LOC, tipocobranca TPC, veiculo VEI, devolucao DEV
@marttosc
marttosc / Card.php
Created May 30, 2016 16:40
Query scope - Laravel 5.2
<?php
namespace App\Card;
use Illuminate\Database\Eloquent\Model;
class Card extends Model
{
...
@marttosc
marttosc / CheckTemporaryPassword.php
Created May 25, 2016 17:36
Using middleware to change response
<?php
namespace App\Http\Middleware;
use Closure;
class PasswordTemporary
{
/**
* Handle an incoming request.