Skip to content

Instantly share code, notes, and snippets.

View trengrj's full-sized avatar

John Trengrove trengrj

  • Brisbane, Australia
  • 08:00 (UTC +10:00)
View GitHub Profile
@trengrj
trengrj / mozilla.R
Last active November 11, 2015 12:03
library(DBI)
library(RSQLite)
con <- dbConnect(SQLite(), "places.sqlite")
alltables = dbListTables(con)
hosts = dbGetQuery( con,'select * from moz_hosts order by frecency desc' )
places = dbGetQuery( con,'select * from moz_places order by visit_count desc' )
library(tm)
docs = Corpus(VectorSource(places$title))
docs <- tm_map(docs, removePunctuation)
docs <- tm_map(docs, tolower)
docs <- tm_map(docs, removeWords, c("bad","words"))
docs <- tm_map(docs, removeWords, stopwords("english"))
docs <- tm_map(docs, stripWhitespace)
docs <- tm_map(docs, PlainTextDocument)
library(ggplot2)
library(wordcloud)
p <- ggplot(subset(wf, freq>40), aes(word, freq))
p <- p + geom_bar(stat="identity")
p
wordcloud(names(freq), freq, min.freq=10)
@trengrj
trengrj / Vagrantfile
Created June 18, 2016 06:37
Vagrantfile for nginx using vagrant-aws
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrant on AWS Example
# Provisioning script
provision_script = <<SCRIPT
#!/bin/bash
SYNC_DIRECTORY=/home/ubuntu/sync
sudo apt-get update

Keybase proof

I hereby claim:

  • I am trengrj on github.
  • I am trengrj (https://keybase.io/trengrj) on keybase.
  • I have a public key whose fingerprint is 3366 CBCB C47B 352E 6BB3 64C5 ECD9 D7B0 15D9 1226

To claim this, I am signing this object:

@trengrj
trengrj / migrating-weaviate-data.ipynb
Created January 17, 2023 11:18
Migrating Weaviate Data
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.