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 os | |
import click | |
import nexmo | |
import string | |
@click.command() | |
@click.argument( | |
"font", | |
type=click.Choice( |
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
# Basic send | |
response = client.send_message({'from':NEXMO, 'to':ME, 'text':'Merry Christmas'}) | |
response['messages'][0]['status'] | |
# Send as my dad | |
response = client.send_message({'from':os.environ['DADS_NUMBER'], 'to':ME, 'text':'I\'m proud of you'}) | |
response['messages'][0]['status'] | |
# Send as Python Glasgow | |
response = client.send_message({'from':'PyGlasgow', 'to':ME, 'text':'Hello!'}) |
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
while True: | |
for infile in glob.glob("pride/*.png"): | |
im = Image.open(infile) | |
pixel_grid = list(im.getdata()) | |
for channel in range(8): | |
pixels = pixel_grid[channel:-1:8] | |
for num, pixel in enumerate(pixels): | |
pixel = darken_color(pixel[0], pixel[1], pixel[2], factor=0.3) | |
set_pixel(mote_hosts, channel + 1, num, pixel[0], pixel[1], pixel[2]) |
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
exports = function(changeEvent) { | |
const http = context.services.get("salesHTTP"); | |
const fullDocument = changeEvent.fullDocument; | |
return http.post({ | |
url: "https://api.pushover.net/1/messages.json", | |
body: { | |
token: context.values.get("PUSHOVER_API_TOKEN"), | |
user: context.values.get("PUSHOVER_USER"), | |
title: 'New Sale', |
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
[{ | |
$addFields: { | |
fizzbuzz: { | |
$switch: { | |
branches: [{ | |
case: { | |
$and: [{ | |
$eq: [{ | |
$mod: ["$counter", 3] | |
}, 0] |
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
{ | |
"_id":{ | |
"$oid":"5e4182c55b13920bcc41ff64" | |
}, | |
"address":{ | |
"address1":"Suite 442", | |
"address2":"855 Owens Track", | |
"city":"Burwell", | |
"country":"USA", | |
"state":"NE", |
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
[ | |
{ "Number of Headers": 9, "Count": 850456 }, | |
{ "Number of Headers": 7, "Count": 646445 }, | |
{ "Number of Headers": 8, "Count": 625424 }, | |
{ "Number of Headers": 11, "Count": 621524 }, | |
{ "Number of Headers": 10, "Count": 577927 }, | |
{ "Number of Headers": 6, "Count": 498719 }, | |
{ "Number of Headers": 5, "Count": 472418 }, | |
{ "Number of Headers": 15, "Count": 408587 }, | |
{ "Number of Headers": 14, "Count": 401035 }, |