Skip to content

Instantly share code, notes, and snippets.

View djmeph's full-sized avatar

DJ Meph djmeph

View GitHub Profile
//Apigee Reg
var apigee = {
orgName: "ORG_NAME",
appName: "APP_NAME",
notifier: "NOTIFIER",
senderID: "SENDER_ID",
init: function () {
document.addEventListener("deviceReady", this.deviceReady, false);
},
deviceReady: function () {
@djmeph
djmeph / json2xml.js
Created October 9, 2014 19:43
json2xml
/* This work is licensed under Creative Commons GNU LGPL License.
License: http://creativecommons.org/licenses/LGPL/2.1/
Version: 0.1
Author: Norman Witte III/2014
Web: http://djmeph.net/
Adapted from https://gist.github.com/c4milo/3738875
*/
window.json2xml = function (o) {
function post($url,$data, $username, $password) {
$file = file_get_contents($data, true);
$process = curl_init();
curl_setopt($process, CURLOPT_URL, $url);
curl_setopt($process, CURLOPT_USERPWD, "$username:$password");
curl_setopt($process, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($process, CURLOPT_HTTPHEADER, $this->headers);
curl_setopt($process, CURLOPT_HEADER, 1);
curl_setopt($process, CURLOPT_VERBOSE, false);
@djmeph
djmeph / HOWTO.md
Last active September 28, 2018 19:16
Radically Self-Reliant Crypto Bot Workshop

Radically Self-Reliant Crypto Bot Workshop

Launch Ubuntu 16.04 EC2 Instance

  1. Select Ubuntu Server 16.04 LTS 64-bit
  2. Recommend General Purpose - t2.small instance type. (1 CPU core, 2GB RAM)
  3. Select a subnet. us-east-1x, us-east-2x, us-west-2x are $0.023/hr for t2.small
  4. Select 8GB GP2 SSD ($0.80/month)
@djmeph
djmeph / map-circle.js
Created December 12, 2018 10:35
Draw a circle in google maps
module.exports = (coord, brng, dist) => {
dist = dist / 3958;
brng = brng.toRad();
var lat1 = coord[1].toRad(), lon1 = coord[0].toRad();
var lat2 = Math.asin(Math.sin(lat1) * Math.cos(dist) + Math.cos(lat1) * Math.sin(dist) * Math.cos(brng));
var lon2 = lon1 + Math.atan2(Math.sin(brng) * Math.sin(dist) * Math.cos(lat1), Math.cos(dist) - Math.sin(lat1) * Math.sin(lat2));
if (isNaN(lat2) || isNaN(lon2)) return null;
return [lon2.toDeg(), lat2.toDeg()];
}
@djmeph
djmeph / README.md
Last active December 12, 2018 23:41
Node.js Meetup - Geospatial Indexing
@djmeph
djmeph / node-meetup-2019-01-16.md
Last active January 16, 2019 21:00
Node.js Detroit Meetup 2019-01-16 - Useful Lambda Utilities for AWS's free tier
@djmeph
djmeph / how-to-photograph-a-supermassive-black-hole-sources.md
Last active May 3, 2019 06:19
How to Photograph a Supermassive Black Hole - Penguicon 2019

Photographing a Supermassive Black Hole

Permalink

https://x.djmeph.net/bh

Sources

The bulk of the presentation was extrapolated from Katie Bouman's 1 hour presentation at Caltech titled, Imaging a Black Hole with the Event Horizon Telescope.

@djmeph
djmeph / open-source-music-coding.md
Last active May 4, 2019 21:09
Open Source Music Coding - Penguicon 2019