NDJSON is a convenient format for storing or streaming structured data that may be processed one record at a time.
- Each line is a valid JSON value
- Line separator is ‘\n’
cat test.json | jq -c '.[]' > testNDJSON.json
NDJSON is a convenient format for storing or streaming structured data that may be processed one record at a time.
cat test.json | jq -c '.[]' > testNDJSON.json
// This code is based on https://en.wikipedia.org/wiki/HSL_and_HSV | |
// Free to use for any purpose. No attribution needed. | |
function rgbToHsl(r, g, b) { | |
r /= 255; g /= 255; b /= 255; | |
let max = Math.max(r, g, b); | |
let min = Math.min(r, g, b); | |
let d = max - min; | |
let h; | |
if (d === 0) h = 0; |
## convert HTML POST data or HTTP GET query string to JSON | |
## get the raw post data from the AWS built-in variable and give it a nicer name | |
#if ($context.httpMethod == "POST") | |
#set($rawAPIData = $input.path('$')) | |
#elseif ($context.httpMethod == "GET") | |
#set($rawAPIData = $input.params().querystring) | |
#set($rawAPIData = $rawAPIData.toString()) | |
#set($rawAPIDataLength = $rawAPIData.length() - 1) | |
#set($rawAPIData = $rawAPIData.substring(1, $rawAPIDataLength)) |
So you want to create a pex that packages your script and its dependencies?
Ok - first to make our script! Call it foo.py:
import requests
if __name__ == '__main__':
req = requests.get("https://raw.githubusercontent.com/pantsbuild/pex/master/README.rst")
print req.text.split("\n")[0]
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
from igraph import * | |
import numpy as np | |
# Create the graph | |
vertices = [i for i in range(7)] | |
edges = [(0,2),(0,1),(0,3),(1,0),(1,2),(1,3),(2,0),(2,1),(2,3),(3,0),(3,1),(3,2),(2,4),(4,5),(4,6),(5,4),(5,6),(6,4),(6,5)] | |
g = Graph(vertex_attrs={"label":vertices}, edges=edges, directed=True) | |
visual_style = {} |
/** | |
* Generates number of random geolocation points given a center and a radius. | |
* @param {Object} center A JS object with lat and lng attributes. | |
* @param {number} radius Radius in meters. | |
* @param {number} count Number of points to generate. | |
* @return {array} Array of Objects with lat and lng attributes. | |
*/ | |
function generateRandomPoints(center, radius, count) { | |
var points = []; | |
for (var i=0; i<count; i++) { |
# Color Reset | |
Color_Off="\033[0m" # Text Reset | |
# Regular Colors | |
Black="\033[0;30m" # Black | |
Red="\033[0;31m" # Red | |
Green="\033[0;32m" # Green | |
Yellow="\033[0;33m" # Yellow | |
Blue="\033[0;34m" # Blue | |
Purple="\033[0;35m" # Purple |
Here are a list of headless browsers that I know about: