Some of these Groovy scripts can be pasted into user jobs, and others require Admin script console access.
The low-diskspace was forked from someone else.
I made the multiAxis.groovy --though it seems so simple that it should be built in.
class edict(dict): # Similar to bunch, but less, and JSON-centric | |
# based on class dotdict(dict): # from http://stackoverflow.com/questions/224026/dot-notation-for-dictionary-keys | |
__setattr__= dict.__setitem__ # TBD: support assignment of nested dicts by overriding this? | |
__delattr__= dict.__delitem__ | |
def __init__(self, data): | |
if type(data) in ( unicode, str ): | |
data = json.loads( data) | |
Some of these Groovy scripts can be pasted into user jobs, and others require Admin script console access.
The low-diskspace was forked from someone else.
I made the multiAxis.groovy --though it seems so simple that it should be built in.
Testing Git's code view odd red-background
#!/bin/bash | |
# coin-performers.sh | |
# finds best and worst cryptocurrency performers according to coinmarketcap.com | |
# quick hacky bash script could use refactoring into Python or something... | |
window=${1:-"[1-9]+[dh]"} | |
now=$(date +%s) | |
# cache the top 100 |
I hereby claim:
To claim this, I am signing this object:
Excerpt from https://github.com/dwyl/learn-aws-lambda#hello-world-example-zip
.js
file we created earlier: $ zip -r hello-world.zip hello-world.js
You should now be able to see a .ZIP
file alongside your .js
file.
NOTE: If your function has any dependencies then you must include your node_modules
file within your .ZIP file. Simply add node_modules
after the files you wish to zip up!
#!/usr/bin/env python3 | |
""" | |
Very simple HTTP server in python for logging requests | |
Usage:: | |
./server.py [<port>] | |
""" | |
from http.server import BaseHTTPRequestHandler, HTTPServer | |
import logging | |
class S(BaseHTTPRequestHandler): |
#!/usr/bin/env python | |
# kafka-listen.py # optional args: -a for all, or regex pattern of topics | |
import datetime, json, os, sys | |
import kafka # pip install kafka-python | |
KAFKA_SERVER = "kafka-esque.servicebus.windows.net:9093" | |
KAFKA_TOPIC = "test-topic" |