Skip to content

Instantly share code, notes, and snippets.

View icub3d's full-sized avatar

Joshua Marsh icub3d

  • Optum
  • USA
View GitHub Profile
@icub3d
icub3d / colorize.sh
Last active August 29, 2015 13:57 — forked from anonymous/colorize.sh
Automatically change the colors of glyphicons.
#!/bin/bash
while read NAME HEX; do
for i in `find -name "*-white.svg"`; do
FILENAME=`echo $i | sed -e "s/white/$NAME/g"`
sed -e "s/#FFFFFF/$HEX/g" $i >$FILENAME
PNG=`echo $FILENAME | sed -e "s/svg/png/g"`
convert $FILENAME -transparent white $PNG
done
for i in "" "filetypes" "halflings" "social"; do
WHERE="_$i"
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/iconsets/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<link rel="import" href="../core-item/core-item.html">
<polymer-element name="my-element">
<template>
<style>
:host {
@icub3d
icub3d / designer.html
Created December 18, 2014 19:39
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
@icub3d
icub3d / publish.go
Created October 2, 2015 02:14 — forked from sdomino/publish.go
package main
import (
"archive/tar"
"compress/gzip"
"crypto/md5"
"fmt"
"io"
"log"
"os"
@icub3d
icub3d / fibonacci.go
Created August 3, 2012 06:09
Determinism Counts! (Memoization)
package main
import (
"fmt"
"time"
)
func Fibonacci(n int64) int64 {
var f int64
@icub3d
icub3d / config.go
Created January 17, 2013 07:29
A complete example of creating a service in go using RPC.
// greeter/config.go
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"sync"
)
@icub3d
icub3d / addressbook.proto
Created July 31, 2013 13:20
Protobuf in Go
package main;
message Person {
required string name = 1;
required int32 id = 2;
optional string email = 3;
enum PhoneType {
MOBILE = 0;
HOME = 1;
@icub3d
icub3d / main.go
Created August 7, 2013 21:56
An example of how to use mgo, the MongoDB driver for Go.
package main
import (
"bufio"
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"os"
"strings"
)
@icub3d
icub3d / main.go
Created August 8, 2013 00:33
An example of using GridFS in MongoDB.
package main
import (
"bufio"
"fmt"
"io"
"labix.org/v2/mgo"
"os"
"path"
"strings"
@icub3d
icub3d / mysort.go
Created December 4, 2013 19:59
Interface Performance
package mysort
func min(a, b int) int {
if a < b {
return a
}
return b
}
func insertionSort(data []int, a, b int) {