- If you have a README.md in your collection of Gist files, it will display first in your Gist user overview page https://gist.github.com/$USER
- MarkDown formatting applies
- Other files in the Gist are not displayed on your user overview.
Testing Git's code view odd red-background
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
#!/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:
- I am markhu on github.
- I am markhu (https://keybase.io/markhu) on keybase.
- I have a public key ASDHRT7joG_AT_MR5EVc3CJlLkhlC6qVt9ozQP08XT9sFwo
To claim this, I am signing this object:
Excerpt from https://github.com/dwyl/learn-aws-lambda#hello-world-example-zip
- Zip up this file by typing the following into the command line. The command consists of the first filename which is the zip file you want to create (call it whatever you like .zip) followed by the files you want to zip up. In our example you can see the name of the
.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!
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
#!/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): |
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.
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
#!/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" |
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
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) | |