Skip to content

Instantly share code, notes, and snippets.

{
"always_show_minimap_viewport": true,
"ensure_newline_at_eof_on_save": true,
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
"CVS",
".idea"
#!/bin/bash
sudo apt-get install git curl postgresql nodejs
sudo add-apt-repository ppa:ondrej/php5
sudo apt-get update
sudo apt-get install php5 php-pear
sudo pear config-set auto_discover 1
sudo pear install pear.phpunit.de/PHPUnit
@dundee
dundee / gist:4681935
Created January 31, 2013 10:19
Varnish configuration
acl local {
"localhost";
}
backend default {
.host = "127.0.0.1";
.port = "80";
.first_byte_timeout = 3s;
}
@dundee
dundee / gist:4532848
Created January 14, 2013 19:58
Caching reverse proxy - Nginx vs Varnish - basic benchmark
# Varnish config
backend default {
.host = "127.0.0.1";
.port = "80";
}
# Nginx config
http {
@dundee
dundee / gist:1926257
Created February 27, 2012 18:56
PdoFactory
<?php
class PdoFactory
{
public function __construct($pdoOptions) {
// ...
}
public function create()
@dundee
dundee / gist:1926179
Created February 27, 2012 18:48
AuthenticatorFactory
<?php
class AuthenticatorFactory
{
public function __construct(PdoFactory $pdoFactory)
{
// bla
}
@dundee
dundee / rgb.ino
Created December 26, 2011 13:28
RGB led
// Output
int redPin = 9; // Red LED, connected to digital pin 9
int greenPin = 10; // Green LED, connected to digital pin 10
int bluePin = 11; // Blue LED, connected to digital pin 11
int r, g, b;
int rd, gd, bd;
int wait = 20; //20ms
@dundee
dundee / gist:1508578
Created December 22, 2011 02:08
X-Mass Arduino sketch
/**
* X-Mas Arduino sketch
* Uses 11 LEDs (digital pin 3 to pin 13) and one switch (digital pin 0)
*/
int switchPin = 0; // Switch connected to digital pin 0
int ledPins[] = {13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3};
int ledCount = 11;
@dundee
dundee / gist:1275043
Created October 10, 2011 10:58
Rychlost foreach vs array_map
<?php
$x = 3;
$max = 1000000;
$arr = array(
1,
2,
3,
);
@dundee
dundee / gist:1274919
Created October 10, 2011 09:05
Foreach vs array_reduce
<?php
$arr = array(
array('a', '1'),
array('b', '2'),
);
// klasicky
$out = array();