I hereby claim:
- I am kvbik on github.
- I am kvbik (https://keybase.io/kvbik) on keybase.
- I have a public key ASAkBk-4on0EHqAwp69X3Cxw0hHo_44sk6JctMNHkruRbwo
To claim this, I am signing this object:
#!/bin/bash | |
# git clone https://gist.github.com/kvbik/2f90a73d3acd9fb1ef4d2a45c5f9cfe8 | |
# current macos wifi connection, thx to | |
# https://apple.stackexchange.com/questions/81221/how-do-i-get-wi-fi-info-from-within-terminal | |
W=$( | |
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | \ | |
sed -n '/^[ ]*SSID: / s/^[ ]*SSID: //p' | |
) |
I hereby claim:
To claim this, I am signing this object:
class WeNeedArgumentsException(Exception): | |
pass | |
def min(*args, key=lambda x: x): | |
sequence = args | |
if len(args) == 1: | |
sequence = args[0] | |
if len(sequence) == 0: | |
raise WeNeedArgumentsException('we need arguments') |
Nastavit http://bit.ly/pyworking-prg-01 | |
======================================= | |
* Pythonanywhere.com - ucet | |
* Github.com - ucet | |
* Vytvorit na https://github.com repository "prvniblog" | |
- Initialize with README | |
- Add .gitignore Python | |
- Create repository |
TMP_HUBOT=/tmp/blah | |
MY_HUBOT=/tmp/realhubot | |
# temporary hubot | |
mkdir $TMP_HUBOT | |
cd $TMP_HUBOT | |
npm install hubot coffee-script | |
# init custom hubot | |
./node_modules/.bin/coffee ./node_modules/.bin/hubot --create $MY_HUBOT |
def dump_utc_datetime(x): | |
return ( | |
x.year, x.month, x.day, | |
x.hour, x.minute, x.second, | |
x.microsecond | |
) | |
def load_utc_datetime(x): | |
d = datetime.datetime(*x) | |
return d.replace(tzinfo=pytz.utc) |
var bb = require('./bonescript'); | |
var ledPin0 = bone.USR3; | |
var ledPin1 = bone.P8_3; | |
var ledPin2 = bone.P8_5; | |
var ledPin3 = bone.P8_7; | |
setup = function() { | |
pinMode(ledPin0, OUTPUT); | |
pinMode(ledPin1, OUTPUT); |
for i in `seq 0 3`; do | |
echo 0 > /sys/devices/platform/leds-gpio/leds/beaglebone::usr$i/brightness | |
done | |
echo 1 > /sys/devices/platform/leds-gpio/leds/beaglebone::usr0/brightness | |
sleep 0.2s | |
echo 0 > /sys/devices/platform/leds-gpio/leds/beaglebone::usr0/brightness | |
echo 1 > /sys/devices/platform/leds-gpio/leds/beaglebone::usr2/brightness | |
sleep 0.3s | |
echo 0 > /sys/devices/platform/leds-gpio/leds/beaglebone::usr2/brightness |
#!/usr/bin/env python | |
import time | |
LED = '/sys/devices/platform/leds-gpio/leds/beaglebone::usr%d/%s' | |
def _write(dev, mode='brightness', val=1, sleep=0): | |
s = open(LED % (dev, mode), 'w') | |
s.write(str(val)) | |
s.close() | |
time.sleep(sleep) |
FROM ubuntu:trusty | |
RUN apt-get update | |
RUN apt-get install -qyy \ | |
-o APT::Install-Recommends=false -o APT::Install-Suggests=false \ | |
binutils libproj-dev gdal-bin \ | |
libpq-dev python-dev libxml2-dev libxslt1-dev libffi-dev xmlsec1 \ | |
python2.7 unzip virtualenvwrapper | |
WORKDIR /app |