Skip to content

Instantly share code, notes, and snippets.

View freeeve's full-sized avatar

Eve Freeman freeeve

  • Fairfax, VA
View GitHub Profile
@freeeve
freeeve / aaaa-front-loading-washing-machines-are-evil.md
Last active December 16, 2023 20:34
the saga of the busted front loading maytag washing machine

I have been trying to fix my dad's washing machine for more than a week--it originally got stuck last Thursday with an error message that came on the screen and the door locked (it's a front loading washing machine).

I read up about the error, which is E01 -> F09, which means generally something like "problem in the draining process"-- could be a clog or a busted pump, or apparently even too much soap can cause it. image of manually draining

I managed to break the handle of this drain plug cap because I was using the metal part of the pliers to turn it, like I saw in some youtube video, and it cracked and started leaking, so I ordered a new piece for that, which came wednesday. Oops! image of broken cap

@freeeve
freeeve / bench.js
Created January 28, 2012 22:38
mongodb count benchmark index
var filters = ['abcd', 'efgh', 'ijkl', 'mnop', 'qrst', 'uvwx', 'yz'];
var flen = filters.length;
var n = 1000000;
var max = -1;
function printInterestingStats(explain) {
print(" cursor: " + explain.cursor);
print(" nscanned: " + explain.nscanned);
print(" scanAndOrder: " + explain.scanAndOrder);
print(" millis: " + explain.millis);
#!/bin/python3
import requests
latest_json = requests.get('https://launchermeta.mojang.com/mc/game/version_manifest.json').json().get('versions')[0].get('url')
latest_server_url = requests.get(latest_json).json().get('downloads').get('server').get('url')
print(latest_server_url)
@freeeve
freeeve / output.txt
Last active April 23, 2019 07:37
database/sql/rows to json...
eve-macbook:~ go run rowstojson.go
[
{
"id": 0,
"name": "Peck Duran",
"street": "Chapel Street",
"city": "Orbin",
"zip": "94999",
"state": "Maine",
"email": "ppppp@bbb.com",
@freeeve
freeeve / import.go
Last active October 3, 2018 02:23
go program to import freebase triples into mongodb
package main
import (
"bufio"
"fmt"
"labix.org/v2/mgo"
"os"
"strings"
)
@freeeve
freeeve / neoexample.sh
Created November 13, 2012 20:54
cypher shell script
Wess-MacBook-Pro:bin wfreeman$ cat test.cypher
create (m {name:"m"});
create (n {name:"n"});
Wess-MacBook-Pro:bin wfreeman$ ./neo4j-shell -c < test.cypher
Welcome to the Neo4j Shell! Enter 'help' for a list of commands
NOTE: Remote Neo4j graph database service 'shell' at port 1337
neo4j-sh (?)$ create (m {name:"m"});
+-------------------+
@freeeve
freeeve / restaurant_recommendation.adoc
Last active July 15, 2017 20:14 — forked from jexp/restaurant_recommendation.adoc
Restaurant Recommendation GraphGist

Restaurant Recommendations

Here’s an updated gist.

Here are some changes.

// merge movies
LOAD CSV WITH HEADERS FROM 'http://data.neo4j.com.s3.amazonaws.com/advanced/movies/new_movies.csv' AS row
with toFloat(row.avgVote) as avgVote, toInteger(row.releaseYear) as releaseYear, split(row.genres, ":") as genres, toInteger(row.movieId) as id,
row.title as title
merge (m:Movie {id:id})
set m.title = title,m.avgVote = avgVote,m.releaseYear=releaseYear,m.genres = genres
return count(1)
// merge people
LOAD CSV WITH HEADERS FROM 'http://data.neo4j.com.s3.amazonaws.com/advanced/movies/people.csv' as row
@freeeve
freeeve / batch-import.txt
Last active March 4, 2017 22:25
load csv, neo4j-import, custom batchinserter
- LOAD CSV (Cypher): <10M nodes
- https://gist.github.com/freeeve/89c753f0ad5887949023
- https://github.com/mneedham/graphconnect-training
- https://www.airpair.com/neo4j/posts/getting-started-with-neo4j-and-cypher
- bin/neo4j-import (neo4j 2.2+)
- http://neo4j.com/developer/guide-import-csv/#_super_fast_batch_importer_for_huge_datasets
- implement BatchInserter API (custom, RDF, etc.)
- https://github.com/elegantcoding/Freebase2Neo
- http://neo4j.com/docs/stable/batchinsert-examples.html
// get an idea of schema for node properties
match (n)
with n, keys(n) as ks
limit 100000
unwind ks as k
with n, k
order by k
return distinct labels(n), collect(distinct k)
// query to get actors/directors