Skip to content

Instantly share code, notes, and snippets.

Reed Jessen ReedJessen

View GitHub Profile
View gist:5abb06f78c045573d93c7c570e887e4b
from django.http import HttpResponse
import pandas as pd
def foo():
your_dataframe = pd.Dataframe()
response = HttpResponse(content_type='text/csv')
response['Content-Disposition'] = 'attachment; filename=filename.csv'
results.to_csv(path_or_buf=response,sep=';',float_format='%.2f',index=False,decimal=",")
View reddit-unsubscribe-all-subreddits.js
// Visit https://www.reddit.com/subreddits/ and run the following in console (browser dev tools)
// Wait until all the buttons have visibly toggled, refresh page to confirm.
$('.fancy-toggle-button .remove').each(function(i, elem) { setTimeout(function(){ $(elem).trigger('click'); }, i*500) });
View Reddit Unsave all posts and comments
Open up browser console, for Chrome, hit F12 and copy-paste and enter this
$("a").filter(function(index){return $(this).text()==="unsave"}).click();setTimeout(function(){location.reload();},500);
Repeat until all items are unsaved.
View Blockstack Verification
Verifying my Blockstack ID is secured with the address 1j7jdHTvQFD3Lq9PywG43oRRg1mYZbkee https://explorer.blockstack.org/address/1j7jdHTvQFD3Lq9PywG43oRRg1mYZbkee
@ReedJessen
ReedJessen / NotRonysPatents.md
Created Dec 30, 2016
Query what patent's Rony Abovitz is not an inventor on
View NotRonysPatents.md
MATCH (a:Person)-[r:Invented]->(b:Patent)
MATCH (u:Person {full_name:'Abovitz, Rony'})
WHERE  not (u)-[:Invented]-(b) 
RETURN r
@ReedJessen
ReedJessen / HowManyPatents.md
Created Dec 30, 2016
Query to determine how many Patents are in the dataset
View HowManyPatents.md
MATCH (n:Patent) RETURN count(n)
@ReedJessen
ReedJessen / SearchAbovitz.md
Created Dec 30, 2016
Get all the patents invented by Rony Abovitz
View SearchAbovitz.md
MATCH (a:Person {full_name: 'Abovitz, Rony'}) -[r]-> (b:Patent)
RETURN r
View WriteRelationshipsCypher.md
MATCH(a:Person {full_name: "Jon Doe"})
MATCH(b:Patent {grant_number: "7477713"}) 
MERGE(a)-[:Invented {priority_date:"2004-03-02"}]->(b)
@ReedJessen
ReedJessen / WriteRelationships.md
Created Dec 30, 2016
Methods for writing relationships between two nodes in Neo4j
View WriteRelationships.md
class Neo4jWriter():
    def __init__(self):
        config = configparser.ConfigParser()
        config.read('config.ini')

        user_name = config.get('neo4j credentials', 'user_name')
        password = config.get('neo4j credentials', 'password')
@ReedJessen
ReedJessen / Neo4jIPStreetRun.md
Last active Jan 6, 2017
Runtime for building an Neo4j graph from IP Street Patent Data
View Neo4jIPStreetRun.md
from neo4j_writer import Neo4jWriter
from entity_models import Person, Patent, Company
from IPStreet import client, query


if __name__ == '__main__':
You can’t perform that action at this time.