Skip to content

Instantly share code, notes, and snippets.

View ondrejmirtes's full-sized avatar

Ondřej Mirtes ondrejmirtes

View GitHub Profile
@ondrejmirtes
ondrejmirtes / main.js
Created June 29, 2011 14:09
Curvy corners - různá nastavení
curvyCorners({
tl: { radius: 5 },
tr: { radius: 5 },
bl: { radius: 5 },
br: { radius: 5 },
antiAlias: true
}, '.box,.items,#footer .up,.grey-box,#navigation ul');
curvyCorners({
tl: { radius: 20 },
@ondrejmirtes
ondrejmirtes / HomepageTest.java
Created September 3, 2011 15:33
Selenium 2.0
package fm;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import static org.junit.Assert.*;
public class HomepageTest {
@Test
@ondrejmirtes
ondrejmirtes / github.pub
Created September 5, 2011 07:35
Public key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC1HU7tOnkxGkEG417gQUGBpIudcaRHRNIymYwRLaYdjYLmgC5ds0aMO1i71Qh/p/AT9877DaDmXZKHQgesypc9Zjcrlz4mTA4WI8oMu14yXU8uoMJg4IJ7VM4ig5ywADUf452y/HDdxRh1XEpAp8tbCGtFYJIUj6KV7sCRl/yTIwzEr29bSQKOh8qJrY2NcCZmwEyP2p8SqZsGQBmZWdWzeVvtxDZRZWOjcUixLvJAsPAIAWL3Bgjonb/TKj+YyIOfjbEZ+ZXceucgjvTnqEaCxeCx/OgKM+bjPjNYwjjxtBRqmHzrZcE7LeLUFCSC9z8dj6SW5MGNcGN4zlQIZr+N ondrej@eduroam-95.felk.cvut.cz
@ondrejmirtes
ondrejmirtes / .bash_profile
Created September 12, 2011 08:18
Git configuration
export PS1="\u:\W $ "
#GIT bash by HABR (modified by Dundee)
export PSORIG="$PS1"
function GITBRANCH() {
BRANCH="$(git branch 2>/dev/null | grep '*' | cut -d" " -f2-)"
if [ -n "$BRANCH" ] ; then
export PS1="\u:\W "
export PS1=$PS1$(echo -en "\[\033[00;37m\]$BRANCH \[\033[00m\]")
@ondrejmirtes
ondrejmirtes / in_array.php
Created May 24, 2012 10:47
PHP WTFs - in_array()
<?php
$keys = array(
'scheme',
'user',
'pass',
'host',
'port',
'path',
'query',
@ondrejmirtes
ondrejmirtes / gist:3129530
Created July 17, 2012 13:59
Array contains item starting with X
<?php
$array = array_filter(array('yx', 'y', 'z'));
$exists = count(array_filter($array, function($item) {
return substr($item, 0, 1) === 'x';
})) > 0;
@ondrejmirtes
ondrejmirtes / gist:3941235
Created October 23, 2012 20:12
textField: shouldChangeCharactersInRange: for decimal keyboard
-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
if (textField == self.amountInput) {
if (string.length == 0) {
return YES; // backspace
}
NSNumberFormatter* numberFormatter = [[NSNumberFormatter alloc] init];
[numberFormatter setFormatterBehavior: NSNumberFormatterBehavior10_4];
[numberFormatter setNumberStyle: NSNumberFormatterDecimalStyle];
@ondrejmirtes
ondrejmirtes / AffiliatePartner.php
Created August 30, 2013 10:20
Doctrine bugreport
/**
* @SuppressWarnings(PHPMD.UnusedPrivateField) using GetSet
* @Entity
*/
class AffiliatePartner extends User
{
/**
* @var string
* @Column
@ondrejmirtes
ondrejmirtes / AnimateSequence.h
Created December 26, 2013 14:02
Animate sequence of animations
#import <Foundation/Foundation.h>
@interface AnimateSequence : NSObject
+ (void)animate:(NSArray*)blocks duration:(NSTimeInterval)duration;
@end
<?php declare(strict_types = 1);
class PromiseTimer
{
/** @var \React\EventLoop\LoopInterface */
private $loop;
public function __construct(\React\EventLoop\LoopInterface $loop)
{