Skip to content

Instantly share code, notes, and snippets.

View tomasfejfar's full-sized avatar
🏠
Working from home

Tomáš Fejfar tomasfejfar

🏠
Working from home
View GitHub Profile
@tomasfejfar
tomasfejfar / diff.path
Created March 31, 2014 19:54
diff between nginx (2) and apache (1)
--- /2.txt po III 31 21:31:58 2014
+++ /1.txt po III 31 21:31:48 2014
@@ -4,13 +4,14 @@
GD Version bundled (2.1.0 compatible)
FreeType Support enabled
FreeType Linkage with freetype
-FreeType Version 2.4.10
+FreeType Version 2.4.9
+T1Lib Support enabled
GIF Read Support enabled
@tomasfejfar
tomasfejfar / gist:6da337de445d823442fa
Last active August 29, 2015 14:04
Jaký je business case pro DJ Supermarket?
  • nutně něco potřebuju, abych si mohl uvařit
    • chci si koupit kypřící prášek, vajíčka a vanilkový lusk (protože plánuju péct a nemam nakoupeno a tohle mi chybí)
    • nejvíc mě zajímá čas doručení
    • na DJS nefunguje, protože minimální obj. je 500, než řešit co všechno objednám za 500, tak si skočim do Žabky
  • nákup něčeho co se mi nechce tahat
    • zajímá mě přesnost doručení na plánovaný čas + čas (že to není třeba do druhého dne)
    • když si to takhle naplánuju, tak objednám přes oběd a chci aby mi to dorazilo večer až budu doma
    • zajímá mě sortiment (mají třeba mlíko "s uzávěrem"?)
    • méně mě zajímají malé rozdíly v ceně (~2-5kč na mléce) - kupuju abych to netahal, ne abych ušetřil
  • periodické nákupy
@tomasfejfar
tomasfejfar / bring-to-front.js
Created November 14, 2014 17:17
SVG bring to front
svgBringToFront = function (domElement) {
var parent = domElement.parentElement;
parent.removeChild(domElement);
parent.appendChild(domElement);
}
{
"_index": "logstash-2015.04.14",
"_type": "accesslog",
"_id": "zpnGd2u2Tta2kePty2bDfA",
"_version": 1,
"_score": 1,
"_source": {
"message": "127.0.0.1 - - [14/Apr/2015:14:02:33 +0000] "GET /server-status?auto HTTP/1.1" 401 194 "-" "collectd/5.1.0"",
"@version": "1",
"@timestamp": "2015-04-14T14:55:03.684Z",
oxy.layout.right({}, function() {
out.printHtml('\n <div class="watchDogBox">\n ');
if (accountName != null) {
out.printHtml('\n <div class="popup_watcherNews">\n <a href="#" class="wd">Hlídací pes pro novinky v kategorii</a>\n ');
oxy.popup.insert({categoryId:( currentCategory.id),name:"watcherNews",expirationOptions:( expirationOptions)});
out.printHtml('\n </div>\n ');
} else {
...
}
}
@tomasfejfar
tomasfejfar / gist:1384029
Created November 21, 2011 21:37
DIC & DICProxy
<?php
class DICProxy
{
public function __construct($dic, $className) {
//set to private members
}
public function __call($method, $args)
{
return $dic->giveMe($className)->$method($args); //super-simplified
app.views.Viewport = Ext.extend(Ext.Panel, {
initComponent: function() {
//put instances of cards into app.views namespace
Ext.apply(app.views, {
question : new app.views.Question(),
articlesList : new app.views.ArticlesList(),
articlesDetail: new app.views.ArticlesDetail()
/*videos : new app.views.Videos(),
events : new app.views.Events(),
tags : new app.views.Tags(),
<?php
class Crud_Filter_ValueProcessor_Text extends Crud_Filter_ValueProcessor_Abstract
{
public function isValidFormat($value)
{
return true;
}
public function process($column, $value) {
if ($column->isExactMatch()) {
@tomasfejfar
tomasfejfar / Google.php
Created November 10, 2012 13:07 — forked from Mikulas/Google.php
GoogleAuth
<?php
use \Nette\Utils\Json;
/**
* Minimalistic Google OAuth2 connector
* @author Mikuláš Dítě
* @license BSD-3
*/
class Google extends Nette\Object
@tomasfejfar
tomasfejfar / gist:4051035
Created November 10, 2012 13:18
Truncating text, keeping full sentences
text = "Were you born 1. 3. 1987 in Prague? Štěpán Jr. lives there for 3 years now! "
expectedResult = "Were you born 1. 3. 1987 in Prague?"
trimText(input = text, characterLimit = 50) == expectedResult