Skip to content

Instantly share code, notes, and snippets.

View MightyPork's full-sized avatar
🐶
meow

Ondřej Hruška MightyPork

🐶
meow
View GitHub Profile
@MightyPork
MightyPork / TreePrinter.java
Last active August 29, 2015 14:19
Binary tree printer
package alg;
import java.util.ArrayList;
import java.util.List;
/**
* Binary tree printer
*
* @author MightyPork
(define (domain CRANE)
(:requirements :strips :typing)
(:types crane box location)
(:predicates
(atB ?x - box ?y - location) ;; box at location
(atC ?x - crane ?y - location) ;; crane at location
(clearL ?l - location) ;; location clear
(clearC ?c - crane) ;; crane empty
(holding ?c - crane ?b - box) ;; crane holding a box
@MightyPork
MightyPork / herodes_launcher
Created May 10, 2015 13:19
Herodes filler bookmarklet
javascript:(function(){if(window.herodes_filler_bookmarklet!==undefined){alert('Bookmarklet already loaded!')}else{document.body.appendChild(document.createElement('script')).src='http://ondrovo.com/data/herodes_fill_bm.js';}})();
// Pozor, když se to uloží jako záložka v Chrome, někdy se ztratí to "javascript:" na začátku.
// Je potřeba dát Edit a zkontrolovat, že je adresa správně
@MightyPork
MightyPork / heading-anchors.js
Last active May 5, 2019 17:06
Add "id" to headings and scroll to heading based on URL
function headingAnchors(self_link_text) {
self_link_text = self_link_text || '#';
var headings = document.querySelectorAll('h1, h2, h3, h4, h5');
for (var i = 0; i < headings.length; i++) {
var e = headings[i];
if (!e.id) {
var tc = e.textContent;
tc = tc.replace(/[^a-z0-9-]/gi, '-')
.replace(/-{2,}/gi, '-')
@MightyPork
MightyPork / tzork-usa-time.json
Last active August 29, 2015 14:23
USA timezones for TZORK
[
{
"name": "Pacific Time",
"tz": "USA, Pacific Time",
"color": "white"
},
{
"name": "Mountain Time",
"tz": "USA, Mountain Time",
"color": "white"
@MightyPork
MightyPork / tzork-twitter-list.json
Created June 22, 2015 19:24
Original Tzork Config
[
{
"name": "@AntonvonRaumer",
"tz": "Germany",
"color": "#FF8585"
},
{
"name": "@ciba43",
"tz": "Latvia",
"color": "#FE2F77"
@MightyPork
MightyPork / dartium-bin.sh
Created June 24, 2015 21:04
Dartium PKGBUILD
# Contributor: T. Jameson Little <[email protected]>
pkgname=dartium-bin
pkgver=1.10.0
pkgrel=1
pkgdesc="Chromium-based browser that includes the Dart virtual machine (integration version built with dart-editor)"
arch=(i686 x86_64)
url="http://www.dartlang.org/dartium/"
license=('BSD')
depends=('libudev.so.0' 'libgcrypt15' 'gconf')
optdepends=()
@MightyPork
MightyPork / geocode.d.ts
Created June 25, 2015 14:45
geocode result
declare interface Location {
lat:number;
lng:number
}
declare interface GeocodeResult {
address_components: {
long_name: string;
short_nam: string;
types: string[];
#!/bin/env python3
import sys,os
import random
import functools
p_sg = ['el', 'la']
p_pl = ['los', 'las']
@MightyPork
MightyPork / FixTwitterBackground.js
Last active August 29, 2015 14:25
Fix Twitter Background
// ==UserScript==
// @name Twitter Background Fixer
// @namespace http://your.homepage/
// @version 0.1
// @description Adds your custom color and image back to twitter's background.
// @author MightyPork
// @match https://twitter.com/
// @grant none
// ==/UserScript==