This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.brianscaturro | |
import org.neo4j.graphdb.RelationshipType | |
object RelTypes extends Enumeration { | |
type RelTypes = Value | |
val KNOWS = Value | |
implicit def conversion(rt: RelTypes) = new RelationshipType() { def name = rt.toString } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global module:false*/ | |
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
concat: { | |
dist: { | |
src: [ | |
'vendor/bootstrap.js', | |
'vendor/underscore.js', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts "Guess a number between 1 and 10\n" | |
goal = rand(10) + 1 | |
until((answer = gets.chomp) == goal.to_s) | |
puts "Too low\n" if answer.to_i < goal | |
puts "Too high\n" if answer.to_i > goal | |
end | |
puts "Good job! You guessed #{goal} correctly!\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Tree | |
attr_accessor :children, :node_name | |
def initialize(node = {}) | |
(node.length == 1) && (@node_name = node.first[0]) || @node_name = 'root' | |
children = (@node_name == 'root') ? node : node[@node_name] | |
@children = [] | |
children.each do |k, v| | |
@children.push(Tree.new({k => v})) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActsAsCsv | |
def self.included(base) | |
base.extend ClassMethods | |
end | |
module ClassMethods | |
def acts_as_csv | |
include InstanceMethods | |
end | |
end | |
module InstanceMethods |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Party := Object clone | |
Party getRowdy := ("Rabble rabble rabble" println) | |
Party getRowdy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sets up a model that depends on resource pools | |
* and catalogs | |
*/ | |
angular.module("uss.services"). | |
factory('CatalogItemModel', ['Catalog', 'ResourcePool', function(Catalog, ResourcePool) { | |
return { | |
setModel: function($scope, /** invoked with first cat */ cfn, /** invoked with first pool */ pfn) { | |
$scope.catalogs = Catalog.query({'public':0}, function(cats){ | |
cfn(cats[0].id); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
solve problems | |
software | |
AngularJS | |
passionate | |
teamwork | |
meet commitments | |
skill | |
proven history of shipping software | |
collaboration | |
creating solutions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _ = require('lodash') | |
, problem = require('../errors').problem; | |
/** | |
* Check the request for a user. If none found | |
* create an API-Problem style error | |
*/ | |
function check(req, res, next) { | |
if (!req.user) return next( | |
problem(new Error("Resource requires authorization"), { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$app = new \Silex\Application(); | |
$doOrder = function(\SimpleXMLElement $order) { | |
$orderService = new OrderService(); | |
$orderService->setBeerId((string) $order['beer_id']); | |
$creditCard = CreditCardFactory::fromXml($order->CreditCard); | |
$orderService->setCreditCard($creditCard); | |
$order = $orderService->createOrder(); |