Skip to content

Instantly share code, notes, and snippets.

View JeffSpies's full-sized avatar
🏠
Working from home

Jeffrey Spies JeffSpies

🏠
Working from home
View GitHub Profile
@JeffSpies
JeffSpies / mappings.json
Created September 12, 2018 15:17
20180912 - Mapping Brainstorming Meeting
{
"schema": {
"properties": {
"title": {
"type": "string",
"_mapping": "arxiv:*.title"
},
"authors": {
"type": "array",
@JeffSpies
JeffSpies / keybase.md
Created September 25, 2017 15:17
keybase.md

Keybase proof

I hereby claim:

  • I am jeffspies on github.
  • I am jeffspies (https://keybase.io/jeffspies) on keybase.
  • I have a public key ASAq8KZwogkjU9_SRX6M628qRj9N78gfhJIedh9ekGGAIwo

To claim this, I am signing this object:

### Keybase proof
I hereby claim:
* I am jeffspies on github.
* I am jeffspies (https://keybase.io/jeffspies) on keybase.
* I have a public key ASAq8KZwogkjU9_SRX6M628qRj9N78gfhJIedh9ekGGAIwo
To claim this, I am signing this object:
# Write after all requests have been made
# - If it crashes, you lose all those time-consuming requests.
# - Doing it again is not respectful to the server you're making requests to.
data = []
for i in my_list_of_things:
response = make_request(i)
item = parse_response(response)
data.append(item)
write_to_disk(data) # could be pickle, json, csv, sqlite leveldb
@JeffSpies
JeffSpies / ember.md
Last active February 6, 2016 20:13
Ember Resources
@JeffSpies
JeffSpies / BitTorrent for Science.md
Last active September 17, 2015 08:03
A storage platform for distributing the stewardship of high-value data

BitTorrent for Science

A storage platform for distributing the stewardship of high-value data

Summary

The Center for Open Science's (COS; http://cos.io) Open Science Framework (OSF; http://osf.io) freely stores a large amount of publically accessible content (e.g., materials, code, datasets, and publications). Stewardship of such high-value data should not exist solely with one organization or institution. Instead, an inclusive approach would allow any person, organization, or institution to contribute to this stewardship by storing and hosting some percentage of the data using a non-proprietary version of the BitTorrent protocol. Not only is BitTorrent a common, decentralized platform for peer-to-peer file sharing, but, because each file (specifically, file segment) is hashed (i.e., a unique fingerprint or signature is generated for each file), content-addressability comes free.

Content-addressable storage (i.e., storage where files are referenced by the signature of their content) is important f

@JeffSpies
JeffSpies / git-mv-remember.sh
Last active August 29, 2015 14:15
Merge two git repositories--move one into another--while retaining history of both
#!/bin/bash
# License: http://www.apache.org/licenses/LICENSE-2.0
# Description: Merge two git repositories--move one into another--while retaining history of both
# WARNING: Before using, backup both repositories.
# Usage: ./git-mv-remember.sh repo_a repo_b relative/path/to/move/a/to/inside/of/b
# Example:
# Repo A:
# A/.git
# A/foo1.txt
@JeffSpies
JeffSpies / gist:7715b7e5a78b88a4986a
Last active August 29, 2015 14:10
Why comments with children comments should neither be allowed to be deleted outright (such that the child comment takes its position) nor edited without a note that an edit was made

#Why comments with children comments should neither be allowed to be deleted outright (such that the child comment takes its position) nor edited without a note that an edit was made

##Deletes

A: Hitler is the worst.

	B: Histler is the best. 
	
		C: No, he's not.
package main
import (
"log"
"net/http"
)
func UploadHandler(w http.ResponseWriter, req *http.Request) {
switch req.Method {
case "POST":
@JeffSpies
JeffSpies / BottleSqlAlchemyTest.py
Created November 7, 2011 22:27
Bottle and SQLAlchemy; Pre-main running twice
import bottle as Web
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String
print 'Outside of main'
##### Database code