Skip to content

Instantly share code, notes, and snippets.

View mishak87's full-sized avatar

Michal Gebauer mishak87

View GitHub Profile
// NetBeans
// var editor = '"C:\\Program Files\\NetBeans 7.0\\bin\\netbeans.exe" "%file%:%line%" --console suppress --nosplash';
// PhpStorm
//var editor = '"C:\\Program Files (x86)\\JetBrains\\PhpStorm 5.0.4\\bin\\PhpStorm.exe" --line %line% "%file%"';
// var phpStorm = '"C:\\Program Files (x86)\\JetBrains\\PhpStorm 6.0.3\\bin\\PhpStorm.exe" --line %line% "%file%"';
var phpStorm = '"C:\\Program Files (x86)\\JetBrains\\PhpStorm 7.1\\bin\\PhpStorm.exe" --line %line% "%file%"';
// jEdit
//~ var editor = '"C:\\Program Files (x86)\\jEdit\\jedit.exe" "%file%" +line:%line% -reuseview';
@mishak87
mishak87 / ip.conf
Created April 23, 2014 01:39
Nginx: Support only requests with Host header (disable access via bare IP)
# this file blocks ip requests - only request with Host are supported
server {
listen 80 default_server;
listen 443 default_server ssl;
server_name _;
return 444;
}
// go to http://bower-component-list.herokuapp.com/
// include jQuery
var
data,
dots = 0,
dashes = 0;
jQuery.get('http://bower-component-list.herokuapp.com/', function (payload) {
data = payload;
});
@mishak87
mishak87 / email.latte
Created June 11, 2014 20:56
Layouts using rixxi/mail-message-factory
{layout email.layout.latte}
{block subject}xyz{/block}
{block content}
Some html...
{/block}
{* missing another block *}
@mishak87
mishak87 / netteForms.semantic-ui.js
Created June 11, 2014 22:04
Bridge between semantic ui css framework and nette forms validation
var SemanticUi = typeof SemanticUi == 'undefined' ? {} : SemanticUi;
SemanticUi.netteForms = {};
SemanticUi.netteForms.currentError = null;
SemanticUi.netteForms.firstError = null;
/**
* Replaces default Nette behaviour to support SemanticUI theme
*/
SemanticUi.netteForms.addError = function (elem, message) {
@mishak87
mishak87 / example.phpg
Last active August 29, 2015 14:02
Hyphotetical: Example of generating php code with latte
<?php
/**
* {reusable}
*/
class GenericLogOnEventSubscriber implements Subscriber
{
/**
* {args2prop [ private|public|protected]}
*/
<?php
namespace App\Listeners;
use Kdyby\Events\Annotations as Event;
/**
* @Event\Subscriber([<class>])
* <class> is set as default for all handlers
<?php
namespace App;
use Nette;
class ProviderCollector extends Nette\Object
{
@mishak87
mishak87 / deploy.sh
Last active August 29, 2015 14:02
Simple deploy script for demo/sandbox server - supports changed file
#!/bin/bash
echo "Deploy launched."
# fetch new version
git fetch origin
# check for changes
CHANGES=$(git status -s)
@mishak87
mishak87 / DbalBatchFile.php
Created June 18, 2014 22:43
With <3 for Hosiplan
<?php
namespace Kdyby\Doctrine\Console;
use Kdyby;
use Kdyby\Doctrine\BatchImportException;
use Kdyby\Doctrine\Helpers;
use Rixxi;
use Symfony;