Skip to content

Instantly share code, notes, and snippets.

View ekeitho's full-sized avatar

Keith Abdulla ekeitho

View GitHub Profile
@ekeitho
ekeitho / designer.html
Created October 13, 2014 20:55
designer
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
getName(), getAge(), getBirthdate(), getHeight(), getWeight(),
getCurrentCity(), getCurrentState(), getAddress(), getHairColor(), getHairStyle()
assertEquals(getName(), “Jim”);
assertEquals(getAge(), “22");
assertEquals(getBirthdate(), “10/31/92");
assertEquals(getHeight(), “6'9”);
assertEquals(getWeight(), “220");
assertEquals(getCurrentCity, “Palo Alto”);
assertEquals(getCurrentState(), “CA”);
assertEquals(getAddress(), “121 Wallabe Way”);
assertEquals(getHairColor(), “Black”);
assertEquals(getHairStyle(), “Fade”);
var stringArray = ['Jim', '22','10/31/92', "6'9", '220',
'Palo Alto', 'CA', '121 Wallabe Way', 'Black', 'Fade'];
### Keybase proof
I hereby claim:
* I am ekeitho on github.
* I am ekeitho (https://keybase.io/ekeitho) on keybase.
* I have a public key whose fingerprint is 5E15 FAA6 6AFA 8B8A 7D6F 1134 DF01 FDEE 9A9C F5A8
To claim this, I am signing this object:
@ekeitho
ekeitho / scan-name.go
Created January 2, 2015 15:36
Scanning from Stdin in Go
package main
import "fmt"
import "text/scanner"
import "os"
func main() {
fmt.Println("Name please..")
@ekeitho
ekeitho / expensive-add.go
Last active August 29, 2015 14:12
Easy demonstration with go-routines.
package main
import "fmt"
import "math/rand"
import "time"
func main() {
central := make(chan int, 300)
rand.Seed(44)
@ekeitho
ekeitho / pre-increment.go
Created January 5, 2015 03:53
Since go doesn't support pre-increment arithmetic (ie. ++add)... my little work around using defer.
package main
import "fmt"
func main() {
add := addFunc()
fmt.Println(add()) //0
fmt.Println(add()) //1
fmt.Println(add()) //2
}
@ekeitho
ekeitho / types.go
Created January 5, 2015 15:53
Type insertion in go ( an example to solve things like java's overload )
package main
import "fmt"
type Person struct{
Name string
Age int
}
func main() {
@ekeitho
ekeitho / CsvToSql.py
Created January 20, 2015 02:47
Takes all row's values in a csv file and wrap them around '( )'. Quick way to insert a lot of values from csv into a mysql database for instance.
import csv
## Keith Abdulla
## email@ekeitho.com
## Cal Poly CPE 365 Databases
class csvParse:
# the file name of the csv file
def __init__(self, file_name):
self.reader = csv.DictReader(open(file_name))