Skip to content

Instantly share code, notes, and snippets.

View roboflank's full-sized avatar
🍇

Denzel Wamburu roboflank

🍇
View GitHub Profile
import csv, json, sys
#if you are not using utf-8 files, remove the next line
#sys.setdefaultencoding("UTF-8") #set the encode to utf8
#check if you pass the input file and output file
if sys.argv[1] is not None and sys.argv[2] is not None:
fileInput = sys.argv[1]
fileOutput = sys.argv[2]
inputFile = open(fileInput) #open json file
outputFile = open(fileOutput, 'w') #load csv file
data = json.load(inputFile) #load json content
@roboflank
roboflank / .hyper.js
Created August 1, 2017 21:10
Hyper Terminal Configs
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 14,
// font family with optional fallbacks
@roboflank
roboflank / distance.js
Created July 11, 2017 03:47
Distance Between Two Coordinates
var directionsService = new google.maps.DirectionsService();
var request = {
origin : 'Melbourne VIC', // a city, full address, landmark etc
destination : 'Sydney NSW',
travelMode : google.maps.DirectionsTravelMode.DRIVING
};
directionsService.route(request, function(response, status) {
@roboflank
roboflank / API.md
Created May 6, 2017 20:13 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@roboflank
roboflank / rename_gerbers.py
Created March 8, 2017 08:48 — forked from xesscorp/rename_gerbers.py
Python script for renaming KiCad Gerber files so they'll be accepted by most low-cost PCB fabricators.
#
# KiCad outputs Gerber files with extensions that aren't recognized by the most commonly used
# PCB manufacturers. This Python script renames the files to what they expect.
# Just execute this script in your KiCad project directory and the Gerber files will be renamed.
#
import glob
import os
# Make a list of .gbr and .drl files in the current directory.
@roboflank
roboflank / auto.sh
Created February 2, 2017 06:11
Automatically Update site While spinning
#!/bin/sh
info() { echo "INFO: $1"; }
die() { echo "ERROR: $1. Aborting!"; exit 1; }
SRC_ROOT=/usr/local/src
SRC_DIR=$SRC_ROOT/{{ proj_name }}
STATIC_DIR=/usr/share/nginx/html
# stop node apps if they're running
@roboflank
roboflank / menu.html
Created January 17, 2017 04:39
Side Menu example ionic 1
<ion-view class="ionic" ng-controller="AccountCtrl" scroll="true">
<ion-side-menus ng-controller="NavCtrl">
<ion-side-menu-content ng-controller="NavCtrl">
<ion-nav-bar class="bar bar-header bar-positive">
<button class="button icon ion-navicon" ng-click="showMenu()"></button>
<a href="#/about/home" class="button icon ion-more pull-right"></a>
<!-- <ion-nav-buttons side="left">
<button class="button button-icon button-clear ion-navicon" ng-click="showMenu()">
</button>
@roboflank
roboflank / firmatatest.js
Created December 8, 2016 13:05 — forked from ajfisher/firmatatest.js
Serial comms over hardware UART for Johnny-Five between Arduino and a Raspberry Pi
var firmata = require('firmata');
var repl = require('repl');
var board = new firmata.Board('/dev/ttyAMA0',function(err){
//arduino is ready to communicate
if (err) {
console.log("err:" + err);
return;
}
console.log("Firmata Firing LEDs");

#Ionic Publish Android App

This is the process to publish an ionic android app.

  1. Make sure you set/increment the version number in config.xml ie 0.0.3.

  2. Make sure the android platform has been added

@roboflank
roboflank / release.sh
Created October 1, 2016 08:34 — forked from edorgeville/release.sh
Creates a signed and zipaligned APK from your Ionic project
#!/bin/bash
#
# Creates a signed and zipaligned APK from your Ionic project
#
# Place your keystore in the root of your project and name it <company>.keystore
# Use this script as following :
# $ ./release.sh [company] [version]
#
# Don't forget to gitignore your key and your compiled apks.
#