Skip to content

Instantly share code, notes, and snippets.

View richardhozak's full-sized avatar

Richard Hozák richardhozak

View GitHub Profile
@richardhozak
richardhozak / table_list.rs
Created July 13, 2018 13:11
Test how to list tables with odbc-rs.
extern crate odbc;
extern crate env_logger;
use odbc::*;
fn main() {
env_logger::init();
match connect() {
Ok(()) => println!("Success"),
@richardhozak
richardhozak / nanovg.drawscissor.c
Created April 3, 2018 20:50
Rewritten draw scissor from nanovg demo which does not use manipulate state with nvgSave and nvgRestore (only to save state when function is entered)
void drawScissor(NVGcontext* vg, float x, float y, float t)
{
nvgSave(vg);
nvgTranslate(vg, x, y);
nvgRotate(vg, nvgDegToRad(5));
nvgBeginPath(vg);
nvgRect(vg, -20,-20,60,40);
nvgFillColor(vg, nvgRGBA(255,0,0,255));
nvgFill(vg);
extern crate gl;
extern crate glutin;
extern crate nanovg;
use glutin::GlContext;
use nanovg::{Color, ColoringStyle, FillStyle, Frame, Solidity, Winding};
const INIT_WINDOW_SIZE: (u32, u32) = (400, 400);
fn main() {
@richardhozak
richardhozak / titulky_enhanced.css
Created November 22, 2016 22:26
Titulky.com visual enhancements via injection of css and js.
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("www.titulky.com") {
#cboxOverlay {
display: none !important;
}
#colorbox {
display: none !important;
}
@richardhozak
richardhozak / spotify_remote_display.py
Last active November 22, 2016 16:12
This small script communicated with local Spotify desktop player over HTTP and sends simple commands over socket to connected client. All commands that could be sent are described in script. Server listens on port 7274 by default.
from string import ascii_lowercase
from random import choice
from unidecode import unidecode
import json
import requests
import socket
import threading
SERVER_PORT = 7274
@richardhozak
richardhozak / KickAssTorrents_LinkFixer.user.js
Last active April 16, 2016 16:47 — forked from kalmanolah/KickAssTorrents_LinkFixer.user.js
This userscript for Greasemonkey disables those pesky confirmation dialogs/pages that links in KAT torrent description blocks show when clicked. It should help reduce my stress levels quite a bit.
// ==UserScript==
// @name KickAssTorrents LinkFixer
// @namespace KATLinkFixer
// @description Disables the confirmation dialogs/pages that links in the description block of KAT torrents show when clicked.
// @include /^(http|https)://kat\.cr/[a-zA-Z0-9-]+\.html$/
// @version 1.0.5
// @grant none
// @updateURL https://gist.github.com/zxey/33e8110bdace13101b021398bcc6d6b4/raw/KickAssTorrents_LinkFixer.user.js
// ==/UserScript==
(function(){