Skip to content

Instantly share code, notes, and snippets.

James Thornton espeed

Block or report user

Report or block espeed

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@espeed
espeed / file
Created Apr 1, 2017
freedom_public
View file
{"0.8782798733075599":"-----BEGIN PGP PUBLIC KEY BLOCK-----\r\nCharset: UTF-8\r\n\r\nxv8AAABSBAAAAAATCCqGSM49AwEHAgMEShAYr1ojMCjtyssa+BIi3J1dfY4ATIhh\r\nW6bLseEYxnNJaX25/ecmGIfHwQ6sv0bSzmXbcdZ9zU6ykLKnmTjJ0s3/AAAACDxn\r\naXRodWI+wv8AAACOBBATCABA/wAAAAWCWN/Wjv8AAAACiwn/AAAACZBtT1Ym5Ex2\r\nX/8AAAAFlQgJCgv/AAAABJYDAQL/AAAAApsD/wAAAAKeAQAAS3cBAMjiOyXPpgIE\r\nxsQ/n6GV0Fl+iTHyFXipLHs3qK/l3uaZAP4npvRbZdAWQWug3MT/EEaEbmahxeJA\r\ntQmv7L7Lv9rjMs7/AAAAVgQAAAAAEggqhkjOPQMBBwIDBDS/b2Fja5QAZLp2mYfJ\r\n4pFrcyUCGkCpBn/YN/DlyNyzkqjqZXVh+YmQGOyEJpxBpZq8i/GU0UzN28m5Cnuq\r\nRdkDAQgHwv8AAABtBBgTCAAf/wAAAAWCWN/Wjv8AAAAJkG1PVibkTHZf/wAAAAKb\r\nDAAAt0YBAIxyeFYMf1dONyEuDpq4DDcfOvM3WuspacEevWli1Pt5AQD9UjKIbi1H\r\nW4Uyq2H+b1+iBriO9LDIs1pS2CGKGEKDPg==\r\n=qJ/3\r\n-----END PGP PUBLIC KEY BLOCK-----\r\n"}
@espeed
espeed / onename-jamesthornton.txt
Created Oct 25, 2015
Verifying that +jamesthornton is my blockchain ID. https://onename.com/jamesthornton
View onename-jamesthornton.txt
Verifying that +jamesthornton is my blockchain ID. https://onename.com/jamesthornton
@espeed
espeed / Onename espeed
Created Oct 22, 2015
Verifying that +espeed is my blockchain ID. https://onename.com/espeed
View Onename espeed
Verifying that +espeed is my blockchain ID. https://onename.com/espeed
@espeed
espeed / output
Created Sep 30, 2015
NLTK Trainer NaiveBayes classifier example with most-informative features
View output
python ./nltk-trainer/train_classifier.py ./data/googleNews --instances files --fraction 0.75 --min_score 2 --ngrams 1 2 3 --show-most-informative 10 --classifier NaiveBayes
loading ./data/googleNews
2 labels: ['neg', 'pos']
calculating word scores
using bag of words from known set feature extraction
1682507 words meet min_score and/or max_feats
37116 training feats, 12371 testing feats
training NaiveBayes classifier
accuracy: 0.582815
neg precision: 0.659028
View nltk-trainer-ngram-classifier-example-timed.py
import timeit
import pickle
import nltk.data
from nltk.util import ngrams
t0 = timeit.default_timer()
@espeed
espeed / nltk-trainer-sklearn.MultinomialNB.py
Created Jul 27, 2015
Python NLTK Trainer sklearn.MultinomialNB example
View nltk-trainer-sklearn.MultinomialNB.py
$ python
Python 2.7.10 (default, Jul 5 2015, 14:15:43)
[GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy
>>> scipy.__version__
'0.14.1'
>>> import numpy
>>> numpy.__version__
'1.9.2'
@espeed
espeed / png-to-ico.sh
Created Nov 2, 2014
ImageMagick command to convert PNG file to transparent favicon.ico
View png-to-ico.sh
convert app-icon.png
\( -clone 0 -resize 16x16 \)
\( -clone 0 -resize 32x32 \)
\( -clone 0 -resize 48x48 \)
\( -clone 0 -resize 64x64 \)
-delete 0 -alpha on -background transparent favicon.ico
@espeed
espeed / keybase.md
Created May 15, 2014
Keybase proof
View keybase.md

Keybase proof

I hereby claim:

  • I am espeed on github.
  • I am espeed (https://keybase.io/espeed) on keybase.
  • I have a public key whose fingerprint is 757D F83C 81EA 39D3 7FF8 CFFD 5D24 8053 C813 A32C

To claim this, I am signing this object:

@espeed
espeed / fbme.py
Last active May 20, 2019
Facebook Graph API Example in Python
View fbme.py
# Facebook Graph API Example in Python
# by James Thornton, http://jamesthornton.com
# Facebook API Docs
# https://developers.facebook.com/docs/graph-api/using-graph-api#reading
# Get Your Facebook Access Token Here...
# https://developers.facebook.com/tools/explorer/145634995501895/?method=GET&path=me
# Before running this script...
@espeed
espeed / gist:10725793
Last active Aug 29, 2015
Bulbs-Rexster Unicode Lookup via Gremlin
View gist:10725793
# The vertex is created and indexed via a Gremlin script...
>>> name = 'Universit\u00e9 de Montr\u00e9al'
>>> g.university.create(name=name)
POST url: http://localhost:8182/graphs/emptygraph/tp/gremlin
POST body: {"params":{"keys":null,"index_name":"university","data":{"element_type":"university","name":"Universit\u00e9 de Montr\u00e9al"}},"script":"def createIndexedVertex = {\n vertex = g.addVertex()\n index = g.idx(index_name)\n for (entry in data.entrySet()) {\n if (entry.value == null) continue;\n vertex.setProperty(entry.key,entry.value)\n if (keys == null || keys.contains(entry.key))\n\tindex.put(entry.key,String.valueOf(entry.value),vertex)\n }\n return vertex\n }\n def transaction = { final Closure closure ->\n try {\n results = closure();\n g.commit();\n return results; \n } catch (e) {\n g.rollback();\n throw e;\n }\n }\n return transaction(createIndexedVertex);"}
<University: http://localhost:8182/graphs/emptygraph/vertices/0>
You can’t perform that action at this time.