Skip to content

Instantly share code, notes, and snippets.

View vojtech-dobes's full-sized avatar

Vojtěch Dobeš vojtech-dobes

View GitHub Profile
@nikic
nikic / php-5.5-features.md
Last active August 31, 2020 10:39
List of new features in PHP 5.5
@Majkl578
Majkl578 / gist:5102017
Created March 6, 2013 18:59
nette.ajax.js + Google Analytics
// push new URL into GA pageview tracker
$.nette.ext('ga', {
success: function (payload) {
if (payload.url) {
_gaq.push(['_trackPageview', payload.url]);
}
}
});
@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@LeaVerou
LeaVerou / dabblet.css
Created February 7, 2013 01:38
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
html { background: gainsboro; }
body {
margin: 3em auto 0;
width: 6em;
height: 6em;
$.nette.init(function (rh) {
$(this.linkSelector).off('click.nette', rh).on('click.nette', rh);
$(this.formSelector).off('submit.nette', rh).on('submit.nette', rh);
$(this.buttonSelector).off('click.nette', rh).on('click.nette', rh);
}, {
linkSelector: 'a.ajax',
formSelector: 'form.ajax',
buttonSelector: 'input.ajax[type="submit"], button.ajax[type="submit"], input.ajax[type="image"]'
});
<?php
use Nette\Latte\Compiler;
use Nette\Latte\MacroNode;
use Nette\Latte\PhpWriter;
class Macros extends \Nette\Latte\Macros\MacroSet {
public static function install(Compiler $compiler) {
@NoxArt
NoxArt / Keys.php
Created November 9, 2012 13:58
WebDriver key codes
<?php
class Keys {
const KEY_NULL = "\xEE\x80\x80";
const KEY_CANCEL = "\xEE\x80\x81";
const KEY_HELP = "\xEE\x80\x82";
const KEY_BACKSPACE = "\xEE\x80\x83";
const KEY_TAB = "\xEE\x80\x84";
const KEY_CLEAR = "\xEE\x80\x85";
const KEY_RETURN = "\xEE\x80\x86";
const KEY_ENTER = "\xEE\x80\x87";
@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
@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:

@LeonardoCA
LeonardoCA / AjaxPanels.php
Created July 13, 2012 21:22
AjaxPanelsCompilerExtension
<?php
/**
* This file is part of the AjaxPanels Nette Addon
*
* Copyright (c) 2012 Leonard Odlozilik
*
* For the full copyright and license information, please view
* the file license.txt that was distributed with this source code.
*/