Skip to content

Instantly share code, notes, and snippets.

💭
Shipping Wonderful Products⚡️

Denzel Wamburu wamburu

💭
Shipping Wonderful Products⚡️
View GitHub Profile
View gist:5bfa24dbec6281897fd8c82946cba76e
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
@wamburu
wamburu / .hyper.js
Created Aug 1, 2017
Hyper Terminal Configs
View .hyper.js
// 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
@wamburu
wamburu / distance.js
Created Jul 11, 2017
Distance Between Two Coordinates
View distance.js
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) {
@wamburu
wamburu / API.md
Created May 6, 2017 — forked from iros/API.md
Documenting your REST API
View API.md

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:

@wamburu
wamburu / rename_gerbers.py
Created Mar 8, 2017 — forked from xesscorp/rename_gerbers.py
Python script for renaming KiCad Gerber files so they'll be accepted by most low-cost PCB fabricators.
View rename_gerbers.py
#
# 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.
@wamburu
wamburu / auto.sh
Created Feb 2, 2017
Automatically Update site While spinning
View auto.sh
#!/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
@wamburu
wamburu / menu.html
Created Jan 17, 2017
Side Menu example ionic 1
View menu.html
<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>
@wamburu
wamburu / firmatatest.js
Created Dec 8, 2016 — forked from ajfisher/firmatatest.js
Serial comms over hardware UART for Johnny-Five between Arduino and a Raspberry Pi
View firmatatest.js
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");
View ionic_publish_android_app.md

#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

@wamburu
wamburu / release.sh
Created Oct 1, 2016 — forked from edorgeville/release.sh
Creates a signed and zipaligned APK from your Ionic project
View release.sh
#!/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.
#
You can’t perform that action at this time.