Skip to content

Instantly share code, notes, and snippets.

<?php
namespace FooModel;
use \Nette\Environment;
abstract class BaseModel extends \Nette\Object
{
@Mikulas
Mikulas / gist:1018884
Created June 10, 2011 14:05
Nette addons
Vizuální komponenty
ConfirmationDi­alog Snadné a bezpečné potvrzování akcí 0.9
DataGrid Komponenta pro tvorbu přehledových tabulek a manipulaci s daty alpha
Gridito Odlehčená univerzální varianta klasického datagridu ok
EditableDataGrid Datagrid s možností editace dat přímo v něm ? alpha
EditableTree Nadstavba TreeView alpha
FbTools Sada nástrojů pro práci s Facebook Social Plugins LikeButton, Comments, OpenGraphTags, Like Box ok (prefix verze)
ForumControl Jednoduché vytváření diskuzních fór ok (prefix verze)
GUI for Acl Grafické rozhraní pro správu přístupových práv 0.9
Navigation Usnadňuje tvorbu menu a drobečkové navigace 0.9 (existují nové forky)
@Mikulas
Mikulas / gist:1072648
Created July 8, 2011 19:44
FriendlyMacros
<?php
namespace Nette\Latte\Macros;
use Nette,
Nette\Latte,
Nette\Latte\MacroNode,
Nette\Latte\ParseException,
Nette\Utils\Strings as String;
<!DOCTYPE html>
<html>
<head>
<title>Example Filter Page</>
</>
<body>
<.container>
<#flash.span-24>
<.flash>message content</>
</>
<header></> <!-- Naira -->
<header></header> <!-- Output Html -->
<#main></>
<div id="main"></div>
<.even></>
<div class="even"></div>
<footer#bottom.gray></>
public function templatePrepareFilters($template)
{
$template->registerFilter(new Nette\Templating\Filters\Naira);
$template->registerFilter(new Nette\Latte\Engine);
}
@Mikulas
Mikulas / gist:1166375
Created August 23, 2011 20:14
Moneybookers - list of servers and IPs
The current Moneybookers IP range is as follows:
Server 1 - 91.208.28.4, 91.208.28.5, 91.208.28.6, 91.208.28.7, 91.208.28.8, 91.208.28.9
Server 2 - 93.191.174.4, 93.191.174.5, 93.191.174.6, 93.191.174.7, 93.191.174.8, 93.191.174.9
Server 3 - 193.105.47.4, 193.105.47.5, 193.105.47.6, 193.105.47.7, 193.105.47.8, 193.105.47.9
<?php
$username="username";
$password="password";
$cookie="cookie.txt";
$url_login = "https://login.comcast.net/login";
// login
$ch = curl_init($url_login);
@Mikulas
Mikulas / gist:1952480
Created March 1, 2012 19:27
Typography replacements (xkcd #37)
Replace space thousand separator with thin space (insert if no separator) ~(\d) ?(?=([0-9]{3})+\b)~ ~$1  ~
Replace multiplication x with symbol ~(\b[0-9]+)\s*x\s*([0-9]+)\b~ ~$1×$2~
Ellipses ~\.\.\.~ ~…~
Separate hyphens in ranges with dash ~(\d+)-(\d+)~ ~$1–$2~
Format dates properly (add nonbreaking spaces, remove leading zeros) ~0?(\d{1,2})\.0?(\d{1,2})\.(\d{2})~ ~$1. $2. $3~
@Mikulas
Mikulas / gist:2551307
Created April 29, 2012 15:31
Jerry Coffin's ReadProcessMemory virtual query example
#include <iostream>
#include <vector>
#include <string>
#include <windows.h>
#include <algorithm>
#include <iterator>
template <class InIter1, class InIter2, class OutIter>
void find_all(unsigned char *base, InIter1 buf_start, InIter1 buf_end, InIter2 pat_start, InIter2 pat_end, OutIter res) {
for (InIter1 pos = buf_start;