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 demo doesn't cover case of network connectivity issues (failure to send HTTP POST to Textbelt) | |
//One could just wrap the request around try/catch exception handling for that | |
//Move the demo function into a separate file to make this into a wrapper library you can require/include and then call from a script | |
// A simple wrapper function to send SMS via Textbelt using curl in PHP | |
function sendSmsToTextbelt($number, $message, $locale="USA"){ | |
//determine the Textbelt URL to POST to... |
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
svg { | |
font: 10px sans-serif; | |
} | |
.bar rect { | |
fill: steelblue; | |
shape-rendering: crispEdges; | |
} |
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 node | |
'use strict'; | |
var storm = require("pathTo/storm.js"); //the official storm multilang node client/binding from Apache Storm project | |
var BasicBolt = storm.BasicBolt; | |
TestBolt.prototype = Object.create(BasicBolt.prototype); | |
TestBolt.prototype.constructor = TestBolt; | |
function TestBolt() { |
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
https://blog.cloudboost.io/execute-asynchronous-tasks-in-series-942b74697f9c | |
https://blog.scottlogic.com/2017/09/14/asynchronous-recursion.html |
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
Below are various notes to help if building a custom RF docker image that we don't already have publicly available, | |
e.g. IronPython-based RF docker image, Java/Jython-based RF docker image. | |
java -jar jython_installer-<version>.jar | |
# Robot Framework 3.0 supports Jython 2.7 which requires Java 7 or newer. | |
jython -m ensurepip | |
jython -m pip install robotframework | |
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/sh | |
# use either option below | |
echo ruok | nc zksvr 2181 | |
echo srvr | nc zksvr 2181 |
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
https://webhook.site |
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
various python related commands to run relating to envs | |
apt-get -y update && apt-get -y --force-yes --fix-missing install build-essential python-dev | |
pip install virtualenv | |
virtualenv --system-site-packages -p python3 venv3 | |
source venv3/bin/activate | |
. venv3/bin/activate |
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
// d3.legend.js | |
// (C) 2012 ziggy.jonsson.nyc@gmail.com | |
// MIT licence | |
(function() { | |
d3.legend = function(g) { | |
g.each(function() { | |
var g= d3.select(this), | |
items = {}, | |
svg = d3.select(g.property("nearestViewportElement")), |
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
/* an example of file download in Java w/ minimal amount of code, library imports, | |
* and object instantiations especially if you wrap/encapsulate code like example below. | |
* NOTE: sample code has been tested to work but not thoroughly tested. Use at your own risk. | |
*/ | |
import java.net.*; | |
import java.io.*; | |
//be sure to delete file after working with it. filenamePrefix ~ "test_", file extension ~ ".jpg", include the "." | |
public String downloadFile(String url, String filenamePrefix, String fileExtension) throws Exception{ |