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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
const topics = msg.topic.split('/') | |
let payload | |
try { | |
payload = JSON.parse(msg.payload) | |
} catch (error) { | |
console.log('mqtt2influx: can\'t interpret payload', payload, error) | |
return | |
} |
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 | |
# | |
# Creates a coverage badge svg with bash "only" | |
# Intent is to create a coverage badge in a travis job and uploading it to S3 so it can be displayed in a projects readme | |
# | |
# Uses: bash, read, cut, sed | |
# | |
# Usage: makeCoverageBadge.sh percent target_svg | |
# Example: makeCoverageBadge.sh 81.83 coverage.svg |
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 | |
IFS=$'\n' | |
# List of all localized strings by cat over all string files, then removing comments, empty lines | |
# result is a list of strings like this (including paranthesis): "order_list.title" | |
# - Remove comments from result: | grep -v '/\*' \ | |
# - Remove empty lines: | grep -v '^$' \ | |
LOCALIZED_STRINGS=$(\ | |
find . -name '*.strings' -not -path './Pods/*' -print0 | xargs -0 cat \ | |
| grep -v '/\*' \ |
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
<?php | |
// This script tests if the authentication header is received, | |
// it does so by creating a request with authentication and printing the response. | |
// Location of the php fiel on the server | |
$protocol = (isset($_SERVER['HTTPS']) ? "https" : "http"); | |
$credentials = "username:password"; // Using inline credentials | |
$url = $protocol . '://' . $credentials . '@' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; |
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
(function() { | |
'use strict'; | |
var tiles = []; | |
var activeTiles = []; | |
var inactiveTiles = []; | |
function waitForData() { | |
if($(".widget-size-1x1").length <= 0) { | |
setTimeout(waitForData, 50); |
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
/* | |
Dependencies: request, cheerio | |
npm install cheerio | |
npm install request | |
Run with: | |
node db.js | |
*/ | |
var cheerio = require('cheerio'); |