Skip to content

Instantly share code, notes, and snippets.

#!/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
{
"always_show_minimap_viewport": true,
"ensure_newline_at_eof_on_save": true,
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
"CVS",
".idea"
@dundee
dundee / sublime-keymap
Created May 9, 2014 14:45
Sublime keys
[
{ "keys": ["ctrl+space"], "command": "goto_definition" },
{ "keys": ["f1"], "command": "goto_documentation" },
{ "keys": ["ctrl+shift+up"], "command": "select_lines", "args": {"forward": false} },
{ "keys": ["ctrl+shift+down"], "command": "select_lines", "args": {"forward": true} },
{ "keys": ["insert"], "command": "select_lines" },
]
@dundee
dundee / gist:831bdb68d30c80a0b126
Created December 20, 2014 12:29
Python descriptors and metaclass benchmark
import sys
from datetime import datetime
if sys.version_info[0] == 2:
range = xrange
class StockClassic(object):
@dundee
dundee / test.py
Created May 5, 2015 10:46
My fail
log_file = os.path.join(
log_dir,
'deadlocks'
'{}.log'.format(datetime.datetime.now().strftime('%Y-%m-%d_%H-%M-%S'))
)
@dundee
dundee / test.py
Created June 23, 2015 09:38
Dependency injection by using multiple inheritance
class Robot(object):
def move_forward():
print('Moving forward')
def move_backward():
print('Moving backward')
class CleaningRobot(Robot):
@dundee
dundee / .bashrc
Last active September 25, 2015 15:37 — forked from lexaurin/gist:943888
Shows actual git branch on command prompt
export PS1="$PS1\$(\
export GIT_BRANCH=\"\$(git branch --no-color 2>/dev/null | grep '*' | cut -d\" \" -f2-)\"; \
if [ -n \"\$GIT_BRANCH\" ] ; then \
echo -en \"\[\033[01;33m\]\"\$GIT_BRANCH \"> \[\033[00m\]\"; \
fi \
)"
@dundee
dundee / ssh_config
Created August 5, 2011 12:18
SSH config file (~/.ssh/config)
Host milde
HostName milde.cz
User dundee
Port 1080
Host nagios
HostName nagios.milde.cz
User dundee
Port 1080
IdentityFile ~/.ssh/alternative
@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: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;