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
### Keybase proof | |
I hereby claim: | |
* I am gnitset on github. | |
* I am gnitset (https://keybase.io/gnitset) on keybase. | |
* I have a public key ASBqBzEX36RNCn2qfsepEjMMh35M431KkdnvlXeY-akKHwo | |
To claim this, I am signing this object: |
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
#include <Arduino.h> | |
#include <ESP8266WiFi.h> | |
#include <ESP8266WebServer.h> | |
#include <IRremoteESP8266.h> | |
#include <IRsend.h> | |
const char* ssid = "XXXXX"; | |
const char* password = "XXXXX"; | |
const char* www_username = "admin"; | |
const char* www_password = "esp8266"; |
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 machine | |
rmt = machine.RMT(channel=4, gpio="P12", tx_idle_level=machine.RMT.LOW, tx_carrier=(38000, 50, machine.RMT.HIGH)) | |
# channel 4 ahs a resolution of 1000ns = 1us | |
header = (2220,784) | |
one = (758,1568) | |
zero = (758,804) | |
ptrail = (761,30000) | |
pre_data = 0x48 | |
pre_data_bits = 7 |
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
# Event handler | |
using terms from application "Messages" | |
on message received theText from theBuddy for theChat | |
set quoted_message to quoted form of theText | |
set quoted_id to quoted form of (id of theBuddy as text) | |
do shell script "echo " & quoted_message & " | ~/bin/MessageReceive.sh " & quoted_id & " > /dev/null 2>&1 &" | |
# make messages happy | |
return true | |
end message received |
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
/* | |
* ----------------------------------------------------------------------------- | |
* "THE BEER-WARE LICENSE" (Revision 42): | |
* <gnitset@servern.info> wrote this file. As long as you retain this notice you | |
* can do whatever you want with this stuff. If we meet some day, and you think | |
* this stuff is worth it, you can buy me a beer in return - Klas Meder Boqvist | |
* ----------------------------------------------------------------------------- | |
*/ | |
#include <sys/time.h> |
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
def is_sorted(a): | |
for (c,d) in enumerate(a): | |
if c!=d: | |
return False | |
return True | |
def shuffle(a): | |
a_len=len(a) | |
map(a.extend,zip(a[:a_len/2],a[a_len/2:a_len])) | |
del a[:a_len] |
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
def is_sorted(a): | |
for (c,d) in enumerate(a): | |
if c!=d: | |
return False | |
return True | |
def shuffle(a): | |
a_len=len(a) | |
map(a.extend,zip(a[:a_len/2],a[a_len/2:a_len])) | |
del a[:a_len] |