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)
-- Logs begin at wto 2012-11-13 01:54:02 CET, end at pią 2015-05-01 15:06:49 CEST. --
maj 01 15:02:35 macbook kernel: Initializing cgroup subsys cpuset
maj 01 15:02:35 macbook kernel: Initializing cgroup subsys cpu
maj 01 15:02:35 macbook kernel: Initializing cgroup subsys cpuacct
maj 01 15:02:35 macbook kernel: Linux version 4.0.1-1-ARCH (builduser@tobias) (gcc version 5.1.0 (GCC) ) #1 SMP PREEMPT Wed Apr 29 12:15:20 CEST 2015
maj 01 15:02:35 macbook kernel: e820: BIOS-provided physical RAM map:
maj 01 15:02:35 macbook kernel: BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable
maj 01 15:02:35 macbook kernel: BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved
maj 01 15:02:35 macbook kernel: BIOS-e820: [mem 0x00000000000e0000-0x00000000000fffff] reserved
maj 01 15:02:35 macbook kernel: BIOS-e820: [mem 0x0000000000100000-0x000000003e0f5fff] usable
user, created = User.objects.get_or_create(
param1=foo,
param2=bar
)
Uncaught TypeError: undefined is not a function
bundled.js:7638_.each.Events.(anonymous function)
bundled.js:5941Marionette.CollectionView.Marionette.View.extend._initialEvents
bundled.js:7513(anonymous function)
bundled.js:19075_.before
bundled.js:7620triggerEvents
bundled.js:7561Backbone.Events.trigger
bundled.js:4505(anonymous function)
bundled.js:5711Marionette.View.Backbone.View.extend.triggerMethod
bundled.js:5978Marionette.CollectionView.Marionette.View.extend.render
<link rel="import" href="../bower_components/core-collapse/core-collapse.html">
<polymer-element name="my-collapse">
<template>
<button on-click="{{toggle}}">Click me</button>
<core-collapse id="collapse">
Hello world!
</core-collapse>
</template>
>>> abc = {}
>>> for k, v in resp.cookies.items():
... if k in abc:
... abc[k].append(v)
... else:
... abc[k] = [v]
...
>>> abc
{'statid': ['32dbb464d0bc217e5580f05bce4ca632:c5b35d:1400098838:v3', '32dbb464d0bc217e5580f05bce4ca632:c5b35d:1400098838:v3'], 'reksticket': ['1400098838'], 'rekticket': ['1400098838']}
# 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++)
{