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
config :sentry, | |
use_error_logger: true, | |
dsn: System.get_env("SENTRY_DSN"), | |
environment_name: Mix.env(), | |
root_source_code_path: File.cwd!(), | |
tags: %{ | |
env: Mix.env() | |
}, | |
included_environments: [:prod, :staging], | |
enable_source_code_context: true |
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.Facade do | |
defmacro facade(mod) do | |
quote bind_quoted: [mod: mod] do | |
Enum.each apply(mod, :__info__, [:functions]), fn {fun, arity} -> | |
values = Enum.map(1..arity, &(Macro.var(:"arg#{&1}", mod))) | |
defdelegate unquote(fun)(unquote_splicing(values)), to: mod | |
end | |
end | |
end | |
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
// utilizes the browser eventsystem | |
// usefull in cases where you need communication between independent components | |
// registered events are automatically removed onunload with preserving any other onunload handler | |
var eventsMixin = function(target) { | |
var _subscriptions = []; | |
target.broadcast = function(type, payload) { | |
var ev = new CustomEvent(type, { | |
detail: payload, |
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 Mn = require('backbone.marionette'), | |
Radio = require('backbone.radio'), | |
i18nChannel = Radio.channel('i18n'), | |
_ = require('underscore'); | |
_.extend(Mn.View.prototype, { | |
templateHelpers: { | |
t: function(key){ |
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
.tabbar__content-container { | |
> * { | |
position: absolute; | |
height: 100%; | |
width: 100%; | |
} | |
} | |
.tabbar__items { | |
padding: 0px; |
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 convertDateTimeFieldsToDate = function( date, time, template ) { | |
var startDate = document.querySelector( date ).value, | |
startDateSplitted = startDate.match( /([0-9]{2})\/([0-9]{2})-([0-9]{4})/ ), | |
startTime = document.querySelector( time ).value, | |
startTimeSplitted = startTime.match( /([0-9]{2}):([0-9]{2})/ ), | |
year = startDateSplitted[ 3 ], | |
month = startDateSplitted[ 2 ], | |
day = startDateSplitted[ 1 ], |
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
new Region() | |
.publishedDocuments() | |
.query({whereIn: ['regions.id', regionIds], where: ['publishedDocuments.updated_at', '>=', new Date(timestamp)]}) | |
.fetchAll({withRelated: [ | |
'publishedDocuments.images', | |
'publishedDocuments.ecareSections', | |
'publishedDocuments.regions'] | |
}) | |
.then(function (collection) { | |
var map = {}, keys, i, maxLength, result = []; |
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 knex = require('knex')({ | |
client: 'pg', | |
debug: true, | |
connection: { | |
host: 'localhost', | |
//user: 'your_database_user', | |
//password: 'your_database_password', | |
database: 'ecare_dump_db', | |
charset: 'utf8' | |
} |
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
Meteor.methods({ | |
insertIt: function (name) { | |
var fut = new Future(); | |
Books.insert({title: name}, function(err, result){ | |
if(err){ | |
fut.throw(err); | |
} | |
}); |
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 findAndRemove = function(collection, query){ | |
var promise = new Promise(), | |
remove = function(err, result){ | |
var ids = []; | |
if( err ){ | |
promise.resolve(err); | |
return; | |
} |
NewerOlder