Skip to content

Instantly share code, notes, and snippets.

View floydkots's full-sized avatar

Floyd Kots floydkots

View GitHub Profile
@floydkots
floydkots / keybase.md
Last active November 18, 2018 13:36
I hereby claim that I am floydkots on github and on keybase and I have a public key ASDizqiz8jg5NFE4lFO_MgbkrkMjeBYoEsuDJCz2l_5X2Ao.

Keybase proof

I hereby claim:

  • I am floydkots on github.
  • I am floydkots (https://keybase.io/floydkots) on keybase.
  • I have a public key ASBmkXDUJRKKUSPtdCvgpZJEgXPRsfykET43OIzJHTZWFwo

To claim this, I am signing this object:

@floydkots
floydkots / main.go
Created June 5, 2018 07:48
Generating prime numbers using go routines and channels
package main
import (
"fmt"
"runtime"
)
func main() {
runtime.GOMAXPROCS(4)
ch := make(chan int)
@floydkots
floydkots / main.go
Created June 4, 2018 15:12
Go asynchronous file watcher processing invoices saved as CSV files
package main
import (
"os"
"io/ioutil"
"time"
"encoding/csv"
"strings"
"strconv"
"fmt"
@floydkots
floydkots / main.go
Created June 4, 2018 14:35
Go Asynchronous Web Service Calls
package main
import (
"net/http"
"io/ioutil"
"encoding/xml"
"fmt"
"time"
"runtime"
)
[
{
"code": 1,
"name": "MOMBASA"
},
{
"code": 2,
"name": "KWALE"
},
{
@floydkots
floydkots / CountryCodes.json
Created March 6, 2018 07:48
Country Codes JSON ~ Credits: https://countrycode.org/
[
{
"Country Name": "Afghanistan",
"ISO2": "AF",
"ISO3": "AFG",
"Top Level Domain": "af",
"FIPS": "AF",
"ISO Numeric": 4,
"GeoNameID": 1149361,
"E164": 93,
@floydkots
floydkots / xml.js
Last active January 28, 2018 20:08
Simple classes handling an XML Object and XML Tags
class XMLTag {
constructor(name, value) {
this.name = name;
this.value = value;
this.attributes = {}; //List of attributes (objects)
this.children = [];
}
newTag(name, value) {
@floydkots
floydkots / flattenArray.py
Created December 10, 2017 12:00
Sample python code to flatten an array of arbitrarily nested arrays of integers into a flat array of integers
"""
Author: Floyd Kots ~ github.com/floydkots
This module contains the flatten_array function
"""
def flatten_array(array):
"""
Flatten an array of arbitrarily nested arrays of integers