This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
// type declaration | |
type ErrNegativeSqrt float64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net/http" | |
) | |
type String string | |
type Struct struct { | |
Greeting string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ext.define('App.someclass.SomeClass', { | |
someFunction: function(data) { | |
this.offers = someArrayOfOffers(); | |
var blahCallback = (function (offers, context) { | |
return function(points){ | |
for (var i = 0; i < points.length; i++) { | |
Ext.bind(context.onMarkerTap, context, offers[i], points[i]) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am ejamesc on github. | |
* I am ejames_c (https://keybase.io/ejames_c) on keybase. | |
* I have a public key whose fingerprint is BCED BFC9 A789 5722 5AB9 3ACC E2D5 B0BA 695C 481D | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/codegangsta/negroni" | |
"github.com/gorilla/mux" | |
"log" | |
"net/http" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xlwt | |
import requests | |
API_KEY = "DFIqb6odlalG3lzJbmcSlaaCwM9EkFyaAPzgSeKD9oQTQtWMVm" | |
URL = "http://api.tumblr.com/v2/tagged" | |
def main(search_tag, filename, pages): | |
book = xlwt.Workbook() | |
sh = book.add_sheet(search_tag) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def replace(s, casey) | |
a = s | |
case casey | |
when 1 | |
a.sub("AB", "AA") | |
when 2 | |
a.sub("BA", "AA") | |
when 3 | |
a.sub("CB", "CC") | |
when 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Blog struct { | |
Logger *log.Logger | |
} | |
func NewBlog() (*Blog, error) { | |
var b *Blog | |
logger := log.New(os.Stdout, "[goblawg] ", 0) | |
b.Logger = logger | |
// this explodes with a panic: runtime error: invalid memory address or nil pointer dereference |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
# data taken from http://www.currency-iso.org/en/home/tables/table-a1.html | |
# and consolidated.csv from http://datahub.io/dataset/iso-4217-currency-codes/resource/69ec48a5-4195-4439-92cf-d15096b9b20a | |
current_currencies = set() | |
with open('active_currencies.txt', 'rb') as file: | |
for row in file: | |
r = row.rstrip() | |
current_currencies.add(r) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Afghani|AFN | |
Algerian Dinar|DZD | |
Argentine Peso|ARS | |
Armenian Dram|AMD | |
Aruban Florin|AWG | |
Australian Dollar|AUD | |
Azerbaijanian Manat|AZN | |
Bahamian Dollar|BSD | |
Bahraini Dinar|BHD | |
Baht|THB |
OlderNewer