Skip to content

Instantly share code, notes, and snippets.

@pashields
pashields / reading-list.md
Last active August 17, 2021 20:01
Some things to read

Why Read?

I find myself reading in two very different modes. In one mode, I'm trying to learn something specific typically to unblock me from another task. I might need to know details about a garbage collector or need to know how to write a small compiler. In other cases I'm getting exposed to something entirely new that I know nothing about (e.g lead scoring or purchasing) and need a crash course. It's hard to make general recommendations for this kind of reading. So much is up to the context of your particular topic.

In another mode, I'm trying to broaden my knowledge more generally. I can illuminate gaps in what I know and challenge biases that rarely get checked. In order for this to work, I have to free myself a bit from solving a particular problem. If my reading is a bit more aimless, I'm more likely to get a broader view.

How to read for a broader view

The biggest mistake I made in my youth was avoiding contradiction and ambiguity. When I read something, I was focused on whether I agreed wit

@pashields
pashields / keybase.md
Created February 15, 2019 19:28
keybase.md

Keybase proof

I hereby claim:

  • I am pashields on github.
  • I am pashields (https://keybase.io/pashields) on keybase.
  • I have a public key ASDJHh9CYZxvc4-qCYrgFXlI4dwAWw89uEqjLnb9WnAZ9go

To claim this, I am signing this object:

import java.util.logging.Logger
object Test {
val logger = Logger.getLogger("Test Logger")
def main(args: Array[String]): Unit = {
logger.info(sys.env.get("SPARK_ENV_VAR").toString)
logger.info(sys.env.get("NOT_SPARK_ENV_VAR").toString)
}
}
@pashields
pashields / gist:f7936684c22f9e7a235a
Created December 9, 2014 15:37
ga4gh server install
(2.7)λ pashields server → λ git setuppy-fixmes → python setup.py sdist
running sdist
running egg_info
creating ga4gh.egg-info
writing requirements to ga4gh.egg-info/requires.txt
writing ga4gh.egg-info/PKG-INFO
writing top-level names to ga4gh.egg-info/top_level.txt
writing dependency_links to ga4gh.egg-info/dependency_links.txt
writing entry points to ga4gh.egg-info/entry_points.txt
writing manifest file 'ga4gh.egg-info/SOURCES.txt'
@pashields
pashields / gist:8712295
Created January 30, 2014 16:19
hard coding testing dates
futureAd = Ad.fromJSON JSON.parse adJson
# Haha. Dear future person or alien fixing this test in 2286,
# Sorry. I hoped you all would have given up on javascript
# by now. In that way, I blame this on you. Enjoy your legal weed.
futureAd.flight.startDate = new Date(9999999999999)
module.exports.futureAd = futureAd
@pashields
pashields / line-compare.clj
Last active January 3, 2016 02:09
A little json-y diff action in clojure.
(ns line-compare.core
(:require [cheshire.core :refer :all]
[clojure.set :refer :all]
[clojure.java.io :refer :all]))
(defn read-file
[file]
(with-open [rdr (reader file)]
(set (parsed-seq rdr))))
private static final String[] = {"a", "b", "c"};
public String toDelimitedString(Model record) {
StringBuilder b = new StringBuilder();
// Add n-1 fields with delim
for (int i=0; i<fields.length-1; i++) { // With guava or commons colls could use iter here
b.append(record.get(fields[i]));
b.append(delim);
}
@pashields
pashields / gist:6021292
Created July 17, 2013 14:52
JAVASCRIPT DATES!
debug> repl
Press Ctrl + C to leave debug repl
> this.start
Wed Dec 31 1969 19:00:00 GMT-0500 (EST)
> this.start.valueOf()
'NaN'
>
@pashields
pashields / gist:5460214
Created April 25, 2013 14:40
Engine v1 api doc
AdOS API
========
The AdOS api allows you to bulk request image based ads via a json-based interface.
Request Format
--------------
The basic format of a request is: GET http://engine.adzerk.net/api/v1?request={ url encoded request data }
The request data should be an array of placement objects. A placement object can contain the following fields
* divName [String] an arbitrary unique id for the placement
@pashields
pashields / gist:1837707
Created February 15, 2012 17:51
An example of loading ClassMapper keymappings from a plist file
#import "MapperConfig.h"
@interface MapperConfig (PListReader)
- (void)importFromPList:(NSString*)pListName;
@end
@implementation MapperConfig (PListReader)
- (void)importFromPList:(NSString*)pListName {
NSString *path = [[NSBundle mainBundle] pathForResource:pListName ofType:@"plist"];
NSDictionary *mappings = [[NSDictionary alloc] initWithContentsOfFile:path];