- Clear feature ownership
- Module usage predictibility (refactoring, maintainence, you know what's shared, what's not, prevents accidental regressions, avoids huge directories of not-actually-reusable modules, etc)
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
defmodule RethinkDB.Helpers do | |
def run(query) do | |
query | |
|> do_run | |
|> handle_response | |
end | |
def handle_response(%RethinkDB.Exception.ConnectionClosed{}) do | |
raise "Cannot connect to RethinkDB" |
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
defmodule MyApp.RethinkDB.Helpers do | |
def run(query, opts) do | |
query | |
|> MyApp.Database.run(opts) | |
|> handle_response | |
end | |
def run(query) do | |
run(query, []) |
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
defmodule App.Helpers do | |
use Timex | |
import App.Rethink, only: [run: 1] | |
alias RethinkDB.Query | |
def get(table, id) when is_bitstring(id) do | |
Query.table(table) | |
|> Query.get(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
defmodule App.Query do | |
import App.Database, only: [run: 1] | |
alias RethinkDB.Query | |
def get(table, id) when is_bitstring(id) do | |
Query.table(table) | |
|> Query.get(id) | |
|> run | |
|> catch_errors | |
|> handle_get_response |
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
/* Copyright (C) 2012-2014 Kurt Milam - http://xioup.com | Source: https://gist.github.com/1868955 | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
* | |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TO |
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
IronRouter.prototype.mapResource = function(resource){ | |
var router = this; | |
var _routes = [ | |
{ name: resource, path: '/' + resource, action: 'index' }, | |
{ name: 'show' + resource, path: '/' + resource + '/:id', action: 'show' } | |
]; | |
_.each(_routes, function(route, index){ | |
router.map(function(){ | |
this.route(route.name, { |
#Mac OS X
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
@import "compass/utilities/sprites"; // Include compass sprite helpers | |
@import "compass/css3/background-size"; // Include helper to calc background size | |
@mixin sprite($name, $hover: false, $active: false) { | |
@include retina-sprite($name, $sprites, $sprites2x, $hover, $active); | |
} | |
// The general purpose retina sprite mixin. | |
// |
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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height: 100%; |
NewerOlder