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 / 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 / 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
@jtojnar
jtojnar / MainMovie.as
Created February 15, 2013 21:05
Generování mapy
// Action script...
// [onClipEvent of sprite 114 in frame 4]
onClipEvent (enterFrame) {
if (_parent._parent.cloudMoveX == true) {
this._x = this._x - _parent._parent.cloudSpeed;
} // end if
if (_parent._parent.cloudMoveY == true) {
this._y = this._y - _parent._parent.yMove * 0.500000;
} // end if
@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>
@jtojnar
jtojnar / gist:1240887
Created September 25, 2011 17:47
0048E004
//0048E004
//function sub_0048E004(?:TOknoRodice; ?:?; ?:TFileName; ?:?):?;
//begin
{*
0048E004 push ebp
@jtojnar
jtojnar / gist:1240056
Created September 25, 2011 00:42
Delphi assembly
//0048EE8C
procedure TOknoRodice.btPrihlasitClick;
begin
{*
0048EE8C push ebp
@jtojnar
jtojnar / PlayerListener.java
Created September 24, 2011 20:31
UltraItems
package cz.ogion.ultraitems;
import java.util.Map;
import org.bukkit.entity.Player;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.util.config.ConfigurationNode;
import org.getspout.spoutapi.SpoutManager;
menuField :: Context String
menuField = field "menu" $ \_ -> do
path <- toFilePath <$> getUnderlying
let menuPath = takeDirectory path </> "@menu.md"
unsafeCompiler (readFile menuPath) >>= renderPandoc
@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) {