Skip to content

Instantly share code, notes, and snippets.

@jeffeb3
jeffeb3 / slack_utils.py
Created September 29, 2016 21:48
Post to slack from a MicroPython (esp 8266, version 1.8.4)
def slack_it(msg):
''' Send a message to a predefined slack channel.'''
import urequests
# Get an "incoming-webhook" URL from your slack account. @see https://api.slack.com/incoming-webhooks
URL='https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX'
headers = {'content-type': 'application/json'}
data = '{"text":"%s"}' % msg
@jeffeb3
jeffeb3 / .Xmodmap
Created January 29, 2016 00:08
Xmodmap for mimicking pok3r keyboard layer.
! Trying to F*** with my keyboard.
!
! The theory is that if I make the caps lock be the "Mode_switch" key,
! then I can change what happens for each key when I press the "Mode_switch" key.
!
! I'm not using the "Mode_switch" key anyway...
!
! This will make the caps lock be the "Mode_switch" key.
clear Lock
@jeffeb3
jeffeb3 / gist:c12db4e4c2646ec68ac9
Created January 16, 2015 23:20
How to print the time in python.
#!/usr/bin/env python
import time
print time.time()