Skip to content

Instantly share code, notes, and snippets.

View jiripudil's full-sized avatar

Jiří Pudil jiripudil

View GitHub Profile
@scottjehl
scottjehl / anchorinclude.js
Created May 20, 2011 17:04
Anchor-include Pattern
/*
* anchor-include pattern for already-functional links that work as a client-side include
* Copyright 2011, Scott Jehl, scottjehl.com
* Dual licensed under the MIT
* Idea from Scott Gonzalez
* to use, place attributes on an already-functional anchor pointing to content
* that should either replace, or insert before or after that anchor
* after the page has loaded
* Replace: <a href="..." data-replace="articles/latest/fragment">Latest Articles</a>
* Before: <a href="..." data-before="articles/latest/fragment">Latest Articles</a>
@chriscoyier
chriscoyier / dabblet.css
Created January 31, 2012 05:24
Ratings Stars
/*
Ratings Stars
(with as little code as possible)
*/
.rating {
unicode-bidi: bidi-override;
direction: rtl;
text-align: center;
}
.rating > span {
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@fprochazka
fprochazka / BasePresenter.php
Created October 6, 2012 16:22
Image pipe for #nettefw templates
<?php
/**
* @author Filip Procházka <filip@prochazka.su>
*/
abstract class BasePresenter extends Nette\Application\UI\Presenter
{
/**
* @var \Img\ImagePipe
@Majkl578
Majkl578 / BufferedTextResponse.php
Created October 22, 2012 20:09
BufferedTextResponse
<?php
namespace App\Application\Responses;
use Nette;
class BufferedTextResponse extends Nette\Application\Responses\TextResponse
{
public function send(Nette\Http\IRequest $httpRequest, Nette\Http\IResponse $httpResponse)
{
@enumag
enumag / bardump.php
Created December 11, 2012 22:28
Nette\Diagnostics\Debugger::barDump shortcut
<?php
use \Nette\Diagnostics\Debugger;
/**
* Nette\Diagnostics\Debugger::barDump shortcut.
* @author Jáchym Toušek
* @param mixed $value
*/
function bd($value)
<?php
error_reporting(E_ALL);
class StringTypeHandler {
public function length() {
return strlen($this);
}
}
@juzna
juzna / flow.md
Last active March 14, 2016 17:28
Cooperative Multitasking Components in Nette Framework example

Cooperative Multitasking, Components, Nette & Flow

On GitHub I provide example or Cooperative Multitasking components on a single site served by Nette Framework. These components need to process several network requests to render themselves, which is normally slow.

This example takes advantage of yield operator (available since PHP 5.5) to switch between tasks, Flow as scheduler and Rect as parallel http client.

This post introduces the Flow framework and cooperative multitasking in general.

The Example Application

@oroce
oroce / README.md
Created June 12, 2014 07:51
nginx request id
<?php
use Nette\Application\UI\Presenter;
use Nette\DI\CompilerExtension;
/**
* Auto register presenters as services
* @author Martin Bažík <martin@bazo.sk>