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 | |
# -*- coding: utf-8 -*- | |
""" | |
Put and publish given file to dropbox. | |
Install | |
------- | |
1. open https://www.dropbox.com/developers/apps and register app | |
2. pip install dropbox |
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 | |
# encoding: utf-8 | |
""" | |
pydispatcher demo | |
requirements: pip install pydispatcher | |
""" |
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
from collections import defaultdict | |
from contextlib import contextmanager | |
class Exchange: | |
def __init__(self): | |
self._subscribers = set() | |
def attach(self, task): | |
self._subscribers.add(task) |
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 | |
# firefox profile runner | |
# ln -s ff-runner ff-profilename to run specific profile | |
FIREFOX=/usr/bin/firefox | |
PROFILE=`basename $0|cut -d\- -f2` | |
${FIREFOX} -P ${PROFILE} --no-remote |
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 | |
# encoding: utf-8 | |
import random | |
import fileinput | |
def shakeit(word): | |
if len(word) < 3: | |
return word |
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
# to run snake you need an engine: https://bitbucket.org/Gandi24/pysnake/src/master/ | |
# to watch this snake in action check youtube https://www.youtube.com/watch?v=gc2wpQp95TA (red one) | |
def move(snake1=None, snake2=None, food=None, data=None, board_width=None, board_height=None): # NOQA | |
from math import sqrt | |
from collections import namedtuple | |
Point = namedtuple('Point', 'x y') | |
def d(point): | |
return Point(point.x, point.y + 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
# pip install business-rules | |
from decimal import Decimal | |
from pprint import pprint | |
from business_rules import ( | |
variables, actions, fields, export_rule_data, run_all | |
) | |
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
job: | |
longjob() | |
if [ -f /usr/bin/notify-send ]; then /usr/bin/notify-send -t 60000 -u critical -a "frontend" -c docker,frontend "Docker build" "Frontend docker build at<br/>`pwd`"; fi |
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 | |
""" | |
Usage: | |
using ~/.slackmerc file: | |
$ slackme some info # with `default` profile | |
$ slackme --profile alert some info # using `alert` profile | |
put profile in filename: |
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
import os | |
import re | |
import subprocess | |
from time import sleep | |
from threading import Thread | |
import logging | |
from logging.handlers import RotatingFileHandler | |
from libqtile.config import Key, Screen, Group, Drag, Click, Match | |
from libqtile.command import lazy |