Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<Module>
<!-- název gadgetu a jeho výška -->
<ModulePrefs title="Webová stránka" height="350" />
<!-- malý gadget -->
<Content view="home" type="url" href="http://seznam.cz" />
<!-- maximalizovaný gadget -->
// Final „WTF“ solution for PSmka.cz
"wtf".split("").forEach(function(a,i){$.get("souradnice.php?stav=zmen",{x:i*22+600-(a=="w"?15:0),y:60,id:a+"_c"})});
/**
* AJAX Nette Framwork plugin for jQuery
*
* @copyright Copyright (c) 2009, 2010 Jan Marek
* @copyright Copyright (c) 2009, 2010 David Grudl
* @license MIT
* @link http://nettephp.com/cs/extras/jquery-ajax
*/
(function($) {
<?php
// Print all Exception classes in PHP
foreach (get_declared_classes() as $class)
{
if(is_subclass_of($class, "Exception"))
{
echo $class . "\n";
echo "\tparent: " . get_parent_class($class) . "\n";
@ah01
ah01 / gist:564636
Created September 3, 2010 21:56
Generate yUML class diagram for all Exception classes in PHP
<?php
foreach (get_declared_classes() as $class)
{
if(is_subclass_of($class, "Exception"))
{
$parent = get_parent_class($class);
$color = in_array($class, spl_classes()) ? "{bg:lightblue}" : "";
echo "[$parent]^-[$class$color]\n";
@ah01
ah01 / gist:762576
Last active April 29, 2021 14:10
const.pde
//
// This sketch will print some of interesting predefined constants to Serial.
//
// For more information, look at
// http://electronics4dogs.blogspot.com/2011/01/arduino-predefined-constants.html
// helper macro
#define LINE(name,val) Serial.print(name); Serial.print("\t"); Serial.println(val);
void setup()
@ah01
ah01 / assert.js
Created January 31, 2011 11:54
Tune Up jsFidler
(function () {
var output;
function getOutput () {
if (!output) {
output = document.body.appendChild(document.createElement("pre"));
}
return output;
}
@ah01
ah01 / gist:1030267
Created June 16, 2011 20:59
Show all links on page
javascript:var w = window.open("about:blank", "_blank");w.document.writeln("<pre>");for(var i = 0; i < document.links.length; i++) { var h = document.links[i].href; if (h.indexOf(location.host) < 0) w.document.writeln(h);};void(0);
@ah01
ah01 / gist:1032439
Created June 17, 2011 21:53
Extension Methods
using System;
// Co provede následující program?
//
// a) Vyvolá NullReferenceException
// b) Vypíše "true"
// c) Vypíše "false"
// d) To netuším, jsem Javista a tam Extension Metody nejsou :(
public static class TestProgram
@ah01
ah01 / gist:1654676
Created January 22, 2012 00:12
IsTime function
boolean IsTime(unsigned long *timeMark, unsigned long timeInterval) {
if (millis() - *timeMark >= timeInterval) {
*timeMark = millis();
return true;
}
return false;
}