Skip to content

Instantly share code, notes, and snippets.

View dapicester's full-sized avatar

Paolo D'Apice dapicester

View GitHub Profile
@dapicester
dapicester / config.ru
Created June 6, 2016 02:23
Rack fallback for maintenance
require_relative 'offline'
run Sinatra::Application
@dapicester
dapicester / concept.rb
Created July 29, 2015 08:12
ActiveRecord and ActiveNode
class Concept
include Neo4j::ActiveNode
property :name
def references
Reference.where(concept_uuid: uuid)
end
end
# example: Concept.first.references
@dapicester
dapicester / copy-ssh-id
Created July 8, 2015 01:40
Copy SSH identity
#!/bin/sh
# Append a key (passed as argument $1) to the ~/.ssh/authorized_keys
# file on a targed host.
DOT_SSH=".ssh"
AUTHORIZED_KEYS="$DOT_SSH/authorized_keys"
if [ ! -e $DOT_SSH ]; then
mkdir $DOT_SSH