Skip to content

Instantly share code, notes, and snippets.

View klucar's full-sized avatar

Jim Klucar klucar

  • Nyla Technology Solutions
  • Baltimore, MD
View GitHub Profile
@klucar
klucar / 0_reuse_code.js
Created October 15, 2015 19:29
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@klucar
klucar / jars2classpath.sh
Last active October 15, 2015 19:35
Set CLASSPATH
View jars2classpath.sh
export CLASSPATH=$(find `pwd` -name '*.jar' | xargs echo | tr ' ' ':')
@klucar
klucar / png_colors.js
Created July 8, 2015 15:59
NodeJS script to extract the color palette of a PNG
View png_colors.js
// usage: node png_colors.js | sort | uniq
//
// ignores alpha
var PNG = require('png-js');
var myimage = PNG.load('my_image.png');
myimage.decodePixels(function (pixels) {
for( var ii = 0; ii < pixels.length; ii = ii + 4){
console.log( pixels.readUInt32BE(ii).toString(16).substring(0,6));
@klucar
klucar / swagger.yaml
Last active August 29, 2015 14:22
Myriad Swagger
View swagger.yaml
swagger: '2.0'
info:
version: 0.0.1
title: Myriad API
description: |
Myriad API description
host: localhost:8192
basePath: /api
schemes:
- http
@klucar
klucar / build-and-deploy.sh
Created March 19, 2015 18:04
Scripts for working inside Myriad Vagrant
View build-and-deploy.sh
#!/usr/bin/env bash
./gradlew build
./gradlew capsuleExecutor
sudo -u hduser cp /vagrant/build/libs/* /usr/local/hadoop/share/hadoop/yarn/lib/
sudo -u hduser cp /vagrant/build/libs/myriad-executor-0.0.1.jar /usr/local/libexec/mesos
sudo -u hduser cp /vagrant/build/resources/main/myriad-config-default.yml /usr/local/hadoop/etc/hadoop/.
@klucar
klucar / ECEF2LLA.java
Last active December 28, 2022 20:46
Java stubs for converting ECEF (Earth Centered Earth Fixed) coords to Latitude Longitude Altitude
View ECEF2LLA.java
/*
*
* ECEF - Earth Centered Earth Fixed
*
* LLA - Lat Lon Alt
*
* ported from matlab code at
* https://gist.github.com/1536054
* and
* https://gist.github.com/1536056
@klucar
klucar / ECEF2LLA.matlab
Last active May 19, 2023 06:06
LLA2ECEF matlab
View ECEF2LLA.matlab
% LLA2ECEF - convert latitude, longitude, and altitude to
% earth-centered, earth-fixed (ECEF) cartesian
%
% USAGE:
% [x,y,z] = lla2ecef(lat,lon,alt)
%
% x = ECEF X-coordinate (m)
% y = ECEF Y-coordinate (m)
% z = ECEF Z-coordinate (m)
% lat = geodetic latitude (radians)