Skip to content

Instantly share code, notes, and snippets.

View garyhow01's full-sized avatar

garyhow garyhow01

View GitHub Profile
@garyhow01
garyhow01 / making-zeppelin-work-on-windows.md
Created June 11, 2018 19:18 — forked from codspire/making-zeppelin-work-on-windows.md
Making Zeppelin, Spark, pyspark work on Windows

Zeppelin, Spark, PySpark Setup on Windows (10)

I wish running Zeppelin on windows wasn't as hard as it is. Things go haiwire if you already have Spark installed on your computer. Zeppelin's embedded Spark interpreter does not work nicely with existing Spark and you may need to perform below steps (hacks!) to make it work. I am hoping that these will be fixed in newer Zeppelin versions.

If you try to run Zeppelin after extracting the package, you might encounter "The filename, directory name, or volume label syntax is incorrect."

Google search landed me to https://issues.apache.org/jira/browse/ZEPPELIN-1584, this link was helpful but wasn't enough to get Zeppelin working.

Below is what I had to do to make it work on my Windows 10 computer.

@garyhow01
garyhow01 / Parsing-IBM-Watson-Personality-Insights.js
Created June 20, 2018 14:05
Parsing IBM Watson Personality Insights
// visit https://datamakery.com for more.
function datamakeryf_update_post_candidate( $post_id ) {
$test_answer = wp_strip_all_tags("<INSERT THE ESSAY CONTENT>",true);
$test_answer = str_replace(array("\r\n", "\r", "\n"), '', $test_answer);
$api_url = 'https://gateway.watsonplatform.net/personality-insights/api/v3/profile?version=2017-10-13&consumption_preferences=true&raw_scores=true';
$api_args = array(
'headers' => array(
"Content-type" => "text/html",
"Authorization" => 'Basic ' . base64_encode( '<INSERT AUTH>' )

Offline Python Package Install Notes

Two common cases which make the install of Python packages harder due to networking issues are: a) Install behind a Proxy b) Install without access to the internet

(a) Install behind a Proxy

In the case where the target machine connects to the internet over a network proxy, export the following environment vars, as appropriate - http_proxy and https_proxy. Eg:

@garyhow01
garyhow01 / om.leafletjs.html
Created October 13, 2018 15:06 — forked from ais-one/om.leafletjs.html
onemap.sg on Openlayers v3 & LeafletJS
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.5/leaflet.css" />
<style>
#map { width:640px; height:480px; }
</style>
<script src="http://cdn.leafletjs.com/leaflet-0.7.5/leaflet.js"></script>
<div id="map"></div>
<script type="text/javascript">
var basemap;
var center = [1.355,103.840];
var map2015 = L.tileLayer('http://e1.onemap.sg/arcgis/rest/services/SM256WGS84/MapServer/tile/{z}/{y}/{x}');