This file contains hidden or 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
""" | |
Set this to the current project you're working on. | |
""" | |
SOURCE = 'MLSListings_new' | |
if SOURCE == 'GEPAR': | |
PROJECT_ROOT = 'C:\\Users\\cmcfarland\\Dropbox\\Homesnap\\Projects\\GEPAR\\' | |
sqlfile = PROJECT_ROOT + 'insert_template.sql' |
This file contains hidden or 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
func myMethod (myThing myType) (retVal string, val int) { | |
val = 0 | |
retVal = "Farhan" | |
} | |
func main() { |
This file contains hidden or 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
var _ = require('underscore'); | |
function bootyService(booty) { | |
return function() { | |
if (booty.hadMeLike()) { | |
throw new BootyError('Damn'); | |
} | |
This file contains hidden or 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
#/usr/bin/python3 | |
from datetime import datetime | |
import sys | |
""" | |
Pass the amount you've spent from the command line like this: | |
$ python3 money-left.py 2000 |
This file contains hidden or 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
/* | |
* For posterity, since I'm always looking this up. | |
*/ | |
private void EnsureListingIsVisble(string key) | |
{ | |
// turn off 2 + 8 bits | |
Listing listing = ListingsToAuditDictionary[key]; | |
listing.IDX = listing.IDX ^ (int)ListingIdxEnum.NotSignedInNoListing; // 2 |
This file contains hidden or 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" | |
type IndentationStack []([]string) // type to represent a slice of slice-of-string | |
// can be written like [][]string, i think, but parens make it more clear | |
func main() { | |
var stack IndentationStack | |
stack = make([]([]string), 4) // initialize a slice of slices, length 4, inner slices have length 0! |
This file contains hidden or 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
/* | |
* spec parameter is some JSON object with all the params you need | |
*/ | |
function constructor(spec) { | |
var that = other_constructor(spec), | |
member, |
This file contains hidden or 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 client | |
import ( | |
"encoding/xml" | |
"io" | |
"github.com/paulrosania/go-charset/charset" | |
_ "github.com/paulrosania/go-charset/data" | |
) |
This file contains hidden or 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
// ReportExporter Contains required methods for extracting csv data from SQL queries | |
type ReportExporter interface { | |
FromSqlRow(*sql.Rows) error | |
ToStrings() []string | |
} | |
// Report A type for holding metadata to instantiate the right csv schema as well | |
// as write the correct output filename | |
type Report struct { | |
SQL string |
This file contains hidden or 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
func performUpload(path string) { | |
fmt.Println("uploading:", path) | |
// call this in a goroutine from the main service UploadToS3 | |
creds := credentials.NewStaticCredentials(awsAccessKeyID, secretAccessKey, "") | |
// TODO extract this into a config provider | |
awsConfig := &aws.Config{ | |
Credentials: creds, | |
Region: "us-east-1", | |
} |