Skip to content

Instantly share code, notes, and snippets.

View pagenoare's full-sized avatar

Kacper Krupa pagenoare

View GitHub Profile
switch:
platform: command_line
switches:
heater:
friendly_name: Heater Switch
command_on: "/usr/local/bin/python /config/relay.py open"
command_off: "/usr/local/bin/python /config/relay.py close"
import sys
import socket
TCP_IP = 'ESP_IP'
TCP_PORT = 8080
open_relay = bytes.fromhex('A0 01 00 A1')
close_relay = bytes.fromhex('A0 01 01 A2')
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# coding: utf-8
import calendar
YEAR = 2013
MONTH = 1
c = calendar.Calendar()
dt_calendar = c.monthdatescalendar(YEAR, MONTH)
int_calendar = calendar.monthcalendar(YEAR, MONTH)
# coding: utf-8
import urllib
import re
_PATTERN = re.compile('http://static.simpledesktops.com/uploads/desktops/([^\"]+)')
BASE_URL = 'http://simpledesktops.com/browse/%s/'
LAST_PAGE = 42
def extract_links(page_id):
#include <iostream>
#include <cstdlib>
#define N 100
using namespace std;
void wypelnij(int tab[])
{
for(int i = 0; i <= N; i++)
{
#include <iostream>
#include <math.h>
using namespace std;
void choinka(int n, int add = 0)
{
n *= 2;
for(int i = 1; i <= n; i++)
{
--- eggs/djangorecipe-1.3-py2.6.egg/djangorecipe/wsgi.py 2012-09-19 14:02:46.454096503 +0200
+++ eggs/djangorecipe-1.3-py2.6.egg/djangorecipe/wsgi.py 2012-09-19 22:38:21.573173243 +0200
@@ -4,21 +4,8 @@
def main(settings_file, logfile=None):
- try:
- mod = __import__(settings_file)
- components = settings_file.split('.')
- for comp in components[1:]:
--- eggs/MercurialRecipe-0.1.3-py2.7.egg/mercurialrecipe/__init__.py 2012-03-19 22:33:00.034439787 +0100
+++ eggs/MercurialRecipe-0.1.3-py2.7.egg/mercurialrecipe/__init__.py 2012-08-21 17:18:40.144016509 +0200
@@ -47,7 +47,7 @@
self.source, self.destination
))
shutil.rmtree(self.destination, ignore_errors = True)
- commands.clone(ui.ui(), get_repository(self.source), self.destination)
+ commands.clone(ui.ui(), self.source, self.destination)
return self.destination
@pagenoare
pagenoare / pylint.cfg
Created June 20, 2012 16:36
bin/pylint script [configured for django]
[pylint]
recipe = zc.recipe.egg:scripts
eggs = pylint
${buildout:eggs}
${django:eggs}
scripts = pylint
entry-points = pylint=pylint.lint:Run
arguments = sys.argv[1:]+[
'--output-format=colorized',
'--ignore=migrations',
#!/bin/bash
patch -p0 < patch
sed -i 's/ docs//' Makefile.am &&
cp /usr/share/aclocal/ac_python_devel.m4 . &&
libtoolize -f -c &&
aclocal --force -I. &&
autoheader -f &&
autoconf -f &&
automake -a -c --gnu --foreign &&
./configure --with-irssi="$1" &&