Homebrew is a great little package manager for OS X. If you haven't already, installing it is pretty easy:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
[ | |
{ | |
"id": "83890845.33fc58", | |
"type": "function", | |
"z": "82dda199.0531", | |
"name": "modbus", | |
"func": "var modbus = global.get('modbusserial');\nvar client = new modbus();\n\nclient.connectTelnet(msg.payload.ip, { port: msg.payload.port })\n .then(setClient)\n .then(function() {\n node.warn(\"Connected!\");\n node.status({fill:\"green\", shape:\"dot\", text:\"connected\"});\n })\n .catch(function(e) {\n node.error(\"Disconnected: \" + e.message);\n node.status({fill:\"red\", shape:\"ring\", text:\"disconnected: \" + e.message});\n });\n\nfunction setClient() {\n client.setID(msg.payload.unitid);\n client.setTimeout(10000);\n run();\n}\n\nfunction run() {\n client.readInputRegisters(msg.payload.address, msg.payload.quantity)\n .then(function(d) {\n msg.payload = d.data;\n node.send(msg);\n node.done();\n })\n .catch(function(e) {\n node.error(\"Error: \" |
#!/usr/bin/env bash | |
# fetch_nike_puls_all_activities.bash | |
# A simple bash script to fetch all activities and metrics from NikePlus. | |
# See `nike_plus_api.md` for the API details. | |
readonly bearer_token="$1" | |
if [[ -z "$bearer_token" ]]; then | |
echo "Usage: $0 bearer_token" | |
exit |
<!DOCTYPE html> | |
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> | |
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
extension NSURL { | |
func getQueryItemValueForKey(key: String) -> String? { | |
guard let components = NSURLComponents(URL: self, resolvingAgainstBaseURL: false) else { | |
return nil | |
} | |
guard let queryItems = components.queryItems else { return nil } | |
return queryItems.filter { | |
$0.name == key | |
}.first?.value |
""" | |
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) |
module ElasticSearchHelpers | |
# sanitize a search query for Lucene. Useful if the original | |
# query raises an exception, due to bad adherence to DSL. | |
# Taken from here: | |
# | |
# http://stackoverflow.com/questions/16205341/symbols-in-query-string-for-elasticsearch | |
# | |
def self.sanitize_string(str) | |
# Escape special characters | |
# http://lucene.apache.org/core/old_versioned_docs/versions/2_9_1/queryparsersyntax.html#Escaping Special Characters |