This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print "Import time starts" | |
from lazy_object_proxy import Proxy | |
class Agent1(object): | |
def __init__(self): | |
print "Agent 1 called!" | |
def do_stuff(self): | |
print "Agent 1 doing stuff" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{repos } git init | |
Initialized empty Git repository in /home/ales/repos/.git/ | |
{master repos } git ci -am 'initial' --allow-empty | |
[master (root-commit) 1096524] initial | |
# feature one commits | |
{master repos } git co -b feature-1 | |
Switched to a new branch 'feature-1' | |
{feature-1 repos } touch 1 | |
{feature-1 repos } git add 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'http://www.idnes.cz/?a=://' | |
> /:\/\//.test('http://www.idnes.cz/?a=://') | |
true | |
> /:\/\//.test('www.idnes.cz/?a=://') | |
true | |
> /:\/\//.test('/?a=://') | |
true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fab -f /tmp/fab/bar.py host_type | |
[localhost] local: echo bar | |
bar | |
[localhost] local: uname -s | |
Linux | |
Done. | |
# fab -f /tmp/fab/bar.py host_type | cat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
! Common | |
#define S_yellow #b58900 | |
#define S_orange #cb4b16 | |
#define S_red #dc322f | |
#define S_magenta #d33682 | |
#define S_violet #6c71c4 | |
#define S_blue #268bd2 | |
#define S_cyan #2aa198 | |
#define S_green #859900 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set source = 'default' %} | |
{% if grains['a'] == foo %} | |
{% set source = 'foo' %} | |
{% endif %} | |
/a/b/c.conf: | |
file.managed: | |
- source: salt://{{ source }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MIDDLEWARE_CLASSES = ( | |
'django.middleware.cache.UpdateCacheMiddleware', | |
'django.middleware.common.CommonMiddleware', | |
'staticversions.middleware.DetectGzipSupportMiddleware', | |
'django.contrib.sessions.middleware.SessionMiddleware', | |
'django.middleware.csrf.CsrfViewMiddleware', | |
'scout.middleware.AuthenticationMiddleware', | |
'django.contrib.messages.middleware.MessageMiddleware', | |
'raven.contrib.django.middleware.SentryResponseErrorIdMiddleware', | |
'django.middleware.cache.FetchFromCacheMiddleware', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SESSION=main | |
tmux="tmux -2" | |
# if the session is already running, just attach to it. | |
$tmux has-session -t $SESSION | |
if [ $? -eq 0 ]; then | |
echo "Session $SESSION already exists. Attaching." | |
sleep 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import urllib.request | |
import json | |
ORGANISATION = '' | |
LOGIN = '' | |
TOKEN = '' | |
URL = 'http://github.com/api/v2/json/repos/show/%s?login=%s&token=%s' % (ORGANISATION, LOGIN, TOKEN) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
'sources': | |
[ | |
{ | |
'name': 'bb1', | |
'url': 'http:///..../json', | |
'protocol': 'json', | |
}, | |
{ | |
'name': 'bb2', |