Skip to content

Instantly share code, notes, and snippets.

View anaerobeth's full-sized avatar

Beth Tenorio anaerobeth

  • Healthie
  • Salem, NH
View GitHub Profile

From SQL to Neo4j: Northwind

SQL Model

Neo4j Model

Get the SQL Dump

The SQL dump was stolen from here and imported into MySQL.

!!! Strict
%html{:xmlns => 'http://www.w3.org/1999/xhtml'}
%head
%meta{'http-equip' => 'Content-Type', :content => 'text/html; charset=utf-8'}
%meta{:name => 'viewport', :content => 'widt=device-width, initial-scale=1.0'}
%title= subject
:css
/* Based on The MailChimp Reset INLINE: Yes. */
/* Client-specific Styles */
#outlook a {padding:0;} /* Force Outlook to provide a "view in browser" menu link. */
require 'net/http'
require 'xmlsimple'
url = "http://www.user-agents.org/allagents.xml"
xml_data = Net::HTTP.get_response(URI.parse(url)).body
data = XmlSimple.xml_in(xml_data)
agents = data['user-agent'].select{|agent| type = agent["Type"].first; type.include?("R") || type.include?("S")}
agent_names = agents.collect {|agent| agent["String"].first}

Setup

Git

  1. Download, Install, and setup Git
  2. Get access to https://github.com/opinionlab/oo-support
  • Ask Ray Saller
  1. Clone the the oo-support git repo.
  • > git clone git@github.com:opinionlab/oo-support.git
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
# spec/support/authentication_helper.rb
module AuthenticationHelper
def sign_in_as(user)
visit new_user_session_path
fill_in "Email", with: user.email
fill_in "Password", with: user.password
click_button "Sign in"
function rails_pg() {
rails new $1 -T --database=postgresql &&
cd $1 &&
echo $1 > .ruby-gemset &&
echo 2.0 > .ruby-version &&
echo /config/database.yml >> .gitignore &&
cp config/database.yml config/database.example.yml &&
add_rails_gems &&

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt