Skip to content

Instantly share code, notes, and snippets.

View benkoshy's full-sized avatar

Ben Koshy benkoshy

View GitHub Profile
@benkoshy
benkoshy / gist:50cd81730f45d184ca0f636440d606d2
Last active August 23, 2018 08:17 — forked from cheerfulstoic/gist:3142ed2e15ad08ef6631
Script for "Neo4j.rb Screencast #1 - Create a Neo4j Rails Application"

Welcome to the first episode in a series of short screencasts for the Ruby neo4j gem. Each episode will describe a different aspect of the gem. In this first episode, we will start by discussing how to set up a new Ruby on Rails app using Neo4j. The neo4j gem is not Rails specific so you can use other frameworks like Sinatra or Lotus, but because of the popularity of Ruby on Rails we will be using it for this screencast series.

In this series we're going to create an application to host digital assets which we'll call "asset_portal". To create your Rails app you can run a rails new command as usual. To use Neo4j instead of ActiveRecord you can give arguments which will set up a new Rails app using Neo4j models.

  rails new asset_portal -m http://neo4jrb.io/neo4j/neo4j.rb -O

The dash-m argument runs a script from the neo4j gem project and the dash-capital-O argument says to exclude ActiveRecord. There aren't any restrictions on using Neo4j with other ORMs like ActiveRecord, but you will

// Ok here's the challenge.
// The Tekla API is full of quirks that make absolutely no sense.
// This is one of them.
// Challenge: to everyday, write in just one CLASS attribute which corresponds to an enumeration.
// Hopefully this will be of use to someone. It will save you from remembering and/or looking up the relevant enumeration.
// there are a billion more quirks in the API.
// So I wonder in 100 days whether I will have smashed this out? Only time will tell.
// Wish me luck!
// Mr Dale Nichols suggested the code so I must attribute it.
// I hope to build it up.

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

Rails naming conventions

General Ruby conventions

Class names are CamelCase.

Methods and variables are snake_case.

Methods with a ? suffix will return a boolean.