Skip to content

Instantly share code, notes, and snippets.

View daluu's full-sized avatar

David Luu daluu

View GitHub Profile
@daluu
daluu / Java-WebSocket-1.3.1-SNAPSHOT.pom
Last active August 1, 2023 19:55
Attaching a snapshot of a 3rd party JAR to maven as local repo with a maven based project - an example with Java-Websocket
<?xml version="1.0" encoding="UTF-8"?>
<!-- note that this is somefile.pom not pom.xml, and may not be the same data as in pom.xml -->
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.java-websocket</groupId>
<artifactId>Java-WebSocket</artifactId>
<packaging>jar</packaging>
<name>Java WebSocket</name>
<version>1.3.1-SNAPSHOT</version>
<description>A barebones WebSocket client and server implementation written in 100% Java</description>
@daluu
daluu / sendSmsToTextbelt.php
Last active October 5, 2016 22:58
Simple PHP curl demo for Textbelt
<?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...
@daluu
daluu / index.html
Last active January 31, 2016 23:19 — forked from jltran/index.html
Histogram Overlaid with CDF line to replicate Excel functionality
<!DOCTYPE html>
<meta charset="utf-8">
<style>
svg {
font: 10px sans-serif;
}
.bar rect {
fill: steelblue;
shape-rendering: crispEdges;
}
@daluu
daluu / dataset.csv
Last active February 10, 2016 21:08
Histogram with CDF line overlaid using nvd3.js
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Distance
2.4059769174850905
2.7600000000000002
3.8217080187144488
2.3899284588203313
3.7264403738739054
7.63
3.16
3.1600000000000006
3.160000000000001
@daluu
daluu / index.html
Last active November 22, 2017 22:50
Cumulative Histogram with CDF line
<!DOCTYPE html>
<meta charset="utf-8">
<style>
svg {
font: 10px sans-serif;
}
.bar rect {
fill: steelblue;
shape-rendering: crispEdges;
}
@daluu
daluu / index.html
Created February 1, 2016 01:35
d3 Pareto Chart Example
<!DOCTYPE html>
<meta charset="utf-8">
<style>
svg {
font: 10px sans-serif;
}
.bar rect {
fill: steelblue;
shape-rendering: crispEdges;
}
@daluu
daluu / index.html
Created February 1, 2016 01:43
d3 pareto histogram example with cumulative percentage line (e.g. replica of Excel histogram with pareto and cumulative percentage line options via the data analysis toolpak addon)
<!DOCTYPE html>
<meta charset="utf-8">
<style>
svg {
font: 10px sans-serif;
}
.bar rect {
fill: steelblue;
shape-rendering: crispEdges;
}
@daluu
daluu / additional_notes_on_js_async2sync.txt
Last active November 10, 2018 01:02
Dealing with return values for asynchronous calls in javascript (when you're accustomed to synchronous code)
https://blog.cloudboost.io/execute-asynchronous-tasks-in-series-942b74697f9c
https://blog.scottlogic.com/2017/09/14/asynchronous-recursion.html
@daluu
daluu / read_apache_storm_config_and_bolt_init_and_process_sample.js
Last active October 31, 2018 06:12
Sample bolt showing how to initialize a bolt and read in Apache Storm topology configuration and process tuple in node.js and how to unit test it
#! /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() {
@daluu
daluu / README.md
Last active May 11, 2016 16:11
Custom/additional maven repos to get some not so common maven hosted JARs

Just an example for others and a note for myself in case I need to reference this in the future.

Steps:

Add the custom/additional maven repos where you can find the JARs (that are not hosted on maven central or other common repo)

<repositories>
   <!-- has some useful JARs not hosted on maven central, a popular alternative repo -->