Skip to content

Instantly share code, notes, and snippets.

View moonglum's full-sized avatar

Lucas Dohmen moonglum

View GitHub Profile
@moonglum
moonglum / fizzbuzz.html
Last active November 24, 2015 13:47
This is a FizzBuzz Solution I found on Twitter. It was always shared as a screenshot, so I typed it myself, to try it out ;) Source: https://twitter.com/ericwastl/status/667567483432402944
<html>
<head>
<style>
body {
counter-reset: n;
}
div:before {
counter-increment: n;
content: counter(n);
}

Keybase proof

I hereby claim:

  • I am moonglum on github.
  • I am moonglum (https://keybase.io/moonglum) on keybase.
  • I have a public key whose fingerprint is 1EEF 0573 E355 33E8 1722 042F E203 C1DA 52DA 2D13

To claim this, I am signing this object:

@moonglum
moonglum / books.js
Created December 8, 2014 14:33
Foxx Example App from the Blog Series on the ArangoDB Blog.
/*jslint indent: 2, nomen: true, maxlen: 100 */
/*global require, applicationContext, Joi */
(function () {
'use strict';
var FoxxGenerator = require('foxx_generator').Generator,
Joi = require('joi'),
generator;
generator = new FoxxGenerator('books', {
@moonglum
moonglum / graph.js
Created November 25, 2014 09:37
Short demonstration of using prefixed collections when using graph stuff in Foxx
var relationName = applicationContext.collectionName("containsX");
var vertexCollectionName = applicationContext.collectionName("X");
var graph_module = require("org/arangodb/general-graph");
var sampleGraph = graph_module._graph("sampleGraph");
var contactSpaceGraph = graph_module._graph("sampleGraph");
var vertex = contactSpaceGraph._getVertexCollectionByName(vertexCollectionName);
var edge = contactSpaceGraph._getEdgeCollectionByName(relationName);
var Foxx = require("org/arangodb/foxx");
var controller = new Foxx.Controller(applicationContext);
@moonglum
moonglum / log.txt
Created May 12, 2014 22:21
Log Output from `vagrant up` after `vagrant destroy` in Hacken.in
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'hashicorp/precise64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'hashicorp/precise64' is up to date...
==> default: Setting the name of the VM: hcking_default_1399932017650_56132
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...

Lucas Dohmen

Contact details

Speaker bio

I’m a member of the core team of the NoSQL database project ArangoDB where I work on the graph functionality, tools for the Ruby community to use the database and Foxx. Furthermore I contribute to various open source projects like hacken.in (an event calender for nerds in my hometown written in Rails) and projects related to ArangoDB. You can find me listening or speaking at our local usergroups for Ruby, JavaScript, NoSQL and (as a coach for) Rails Girls and Coder Dojo.

@moonglum
moonglum / ideas.js
Created December 4, 2013 20:28
Ideas for Foxx from the discussion with @mulderp
// Feedback Foxx
Movie = Model.extend({
// attribute? schema?
schema: {
// Long Form
// title: {
// required: false,
// defaultValue: "Unknown",
// type: "String"
@moonglum
moonglum / media-center.md
Created October 6, 2013 08:15
Ok, Nerds. I need some help here.

Media Center

Given I have a Beamer and a Soundbar and I would want to watch movies from an external HDD, the web (Flash + HTML5) and BluRay/DVD. Plus would be Airplay Mirroring, but it's not necessary.

I want to choose the core of this media center. What would you choose? Why?

require "ashikawa-core"
db = Ashikawa::Core::Database.new do |config|
config.url = "http://localhost:8529"
end
collection = db["documenttests"]
document = collection.create_document(:name => "The Dude")
document_key = document.key
@moonglum
moonglum / CommonRescue.rb
Last active December 14, 2015 05:40
A question of taste...
# Imagine you need to "translate" certain exceptions in a
# wrapper around an external library.
# These exceptions can occur in multiple methods, so you
# want to reuse the translation mechanism.
#
# How do you do it? I came up with two solutions:
# 1. Solution: The Bubblewrap
def get_request(params)
bubblewrap_request do