Skip to content

Instantly share code, notes, and snippets.

View jtojnar's full-sized avatar
💤

Jan Tojnar jtojnar

💤
  • ogion.cz
  • Czech Republic
View GitHub Profile
@jtojnar
jtojnar / status.xml
Created September 29, 2015 20:56
IOF XML ResultStatus
<xsd:simpleType name="ResultStatus">
<xsd:annotation>
<xsd:documentation>
The result status of the person or team at the time of the result generation.
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:NMTOKEN">
<xsd:enumeration value="OK">
<xsd:annotation>
<xsd:documentation>
menuField :: Context String
menuField = field "menu" $ \_ -> do
path <- toFilePath <$> getUnderlying
let menuPath = takeDirectory path </> "@menu.md"
unsafeCompiler (readFile menuPath) >>= renderPandoc
@jtojnar
jtojnar / cp-blue-rect-fix.user.js
Last active December 14, 2016 17:58
Club Penguin blue rectangle fix
// ==UserScript==
// @name Club Penguin blue rectangle fix
// @namespace http://fan-club-penguin.cz/
// @version 0.3
// @description Fixes blue rectangles on Club Penguin and also makes it a little faster on some computers
// @author Lisured
// @run-at document-start
// @match http://play.clubpenguin.com/*
// @grant none
// ==/UserScript==
@jtojnar
jtojnar / priklady.md
Last active August 29, 2015 14:13
Příklady
  1. ze vzorce S = 1/2 av_a pro obsah trojúhelníku vyjádříme výšku v_a na stranu a. (neznámá je v_a)
S = 1/2 * a * »v«

S = 1/2 * a * v | *2 (stejné jako kdybychom dělili 1/2)
2 * S = 2 * 1/2 * a * v
2 * S = a * v | /a → podmínka a ≠ 0
2 * S / a = a / a * v
2 * S / a = v
<?php
class ParsedownDetails extends ParsedownExtra {
function __construct() {
$this->BlockTypes['¡'][] = 'Details';
parent::__construct();
}
// Details
protected function blockDetails($Line) {
@jtojnar
jtojnar / full.onboard
Created March 27, 2014 22:59
Onboard layout – full with numeric block
<?xml version="1.0" ?>
<keyboard format="3.1" id="full">
<include file="key_defs.xml"/>
<box border="1" orientation="vertical" spacing="3">
<!--- word suggestions -->
<panel filename="full.svg" scan_priority="1">
<include file="word_suggestions.xml"/>
</panel>
<box spacing="3">
<!--- keyboard, multiple layers -->
@jtojnar
jtojnar / gist:8903976
Created February 9, 2014 18:38
Kobo Aura HD UA string (Firmware 3.1.1, 12/11/13)
Mozilla/5.0 (Linux; U; Android 2.0; en-us;) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 (Kobo Touch)
*PPD-Adobe: "4.3"
*%
*% For information on using this, and to obtain the required backend
*% script, consult http://www.openprinting.org/
*%
*% This file is published under the GNU General Public License
*%
*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
*% all programs and environments which use PPD files for dealing with
*% printer capability information. The printer must be configured with the
@jtojnar
jtojnar / linter.md
Last active December 18, 2015 22:08

This is no longer maintained. Please check my fork.

I wanted SublimeLinter to automatically validate XML against XSD, but this AFAIK isn’t possible so I made a wrapper for xmllint utility to find XSD file in source code and pass it as argument to xmllint. Because XSD paths can be relative I had to change xml.py to use INPUT_METHOD_FILE (@ instead od -) so I could detect file path. Currently the wrapper is quite stupid but it can be changed when I come across something that doesn’t work.

Tested with SublimeLinter3, libxml version 20902 and Python 3.4.3

Save xmllintschema to ~/bin directory (or another directory on path) and set executable bit (chmod +x xmllintschema).

  1. Click PreferencesBrowse Packages → SublimeLinter-xmllint, open linter.py