This file contains 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
require 'active_support/all' | |
class JsFile | |
attr_accessor :path, :file_contents | |
def initialize(path) | |
@path = path | |
@file_contents = File.read(@path) | |
end |
This file contains 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 BulkUpdatable | |
def bulk_update(objects, attribute) | |
return unless objects.any? | |
query = build_query_for(objects, attribute) | |
connection.execute(query) | |
end | |
private |
This file contains 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
'use strict'; | |
var _ = require('lodash'); | |
var request = require('../helpers').request; | |
module.exports = { | |
models: [], | |
loaded: false, |
This file contains 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/puma.rb | |
workers Integer(ENV['WEB_CONCURRENCY'] || 1) | |
threads_count = Integer(ENV['MAX_THREADS'] || 2) | |
threads threads_count, threads_count | |
preload_app! | |
rackup DefaultRackup | |
port ENV['PORT'] || 3000 |
This file contains 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
(function () { | |
'use strict'; | |
window.Card = React.createClass({ | |
mixins: [ReactDND.DragDropMixin], | |
statics: { | |
configureDragDrop: function(register) { | |
register('card', { | |
dragSource: { |
This file contains 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
(function () { | |
'use strict'; | |
var itemTemplate = $('#templates .item'); | |
var list = $('#list'); | |
// when I load the page, I want to get the tasks from the API | |
$.ajax({ | |
type: 'GET', | |
url: "https://listalous.herokuapp.com/lists/lobatis-list", |
This file contains 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 events = (function(){ | |
var topics = {}; | |
function getQueue(topic) { | |
topics[topic] = topics[topic] || []; | |
return topics[topic]; | |
} | |
return { | |
subscribe: function(topic, listener) { |
This file contains 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
ENV["RAILS_ENV"] ||= 'test' | |
require File.expand_path("../../config/environment", __FILE__) | |
require 'rspec/rails' | |
require 'capybara/rspec' | |
RSpec.configure do |config| | |
config.use_transactional_fixtures = false | |
config.treat_symbols_as_metadata_keys_with_true_values = true |
This file contains 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
#!/usr/bin/env ruby | |
ENV['RAILS_ENV'] = 'test' | |
require_relative '../config/environment' | |
class Speccer | |
def configuration | |
@configuration ||= RSpec::Core::Configuration.new | |
end |
This file contains 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 Trashable | |
module ClassMethods | |
def dependent_associations | |
reflect_on_all_associations.select do |association| | |
[:destroy, :delete_all].include?(association.options[:dependent]) | |
end | |
end |
NewerOlder