Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
(e.g. app/models/concerns/, app/models/products/)
| # frozen_string_literal: true | |
| class AssociationLoader < GraphQL::Batch::Loader | |
| attr_reader :klass, :association | |
| def initialize(klass, association) | |
| raise ArgumentError, "association to load must be a symbol (got #{association.inspect})" unless association.is_a?(Symbol) | |
| raise ArgumentError, "cannot load associations for class #{klass.name}" unless klass < ActiveRecord::Base | |
| raise TypeError, "association #{association} does not exist on #{klass.name}" unless klass.reflect_on_association(association) | |
| @klass = klass |
| (function addXhrProgressEvent($) { | |
| var originalXhr = $.ajaxSettings.xhr; | |
| $.ajaxSetup({ | |
| progress: function() { console.log("standard progress callback"); }, | |
| xhr: function() { | |
| var req = originalXhr(), that = this; | |
| if (req) { | |
| if (typeof req.addEventListener == "function") { | |
| req.addEventListener("progress", function(evt) { | |
| that.progress(evt); |
| import React from 'react'; | |
| import request from 'superagent'; | |
| // This import syntax requires the babel transform-export-extensions plugin | |
| import dispatcher, {actions} from '../lib/dispatcher'; | |
| export default class AddContact extends React.Component { | |
| submitHandler(event) { | |
| request.post('/api/contacts') | |
| .send({ | |
| firstName: this.refs.firstName.value, |
| import React from 'react' | |
| import assign from 'object-assign' | |
| var styles = {} | |
| class Autocomplete extends React.Component { | |
| static propTypes = { | |
| initialValue: React.PropTypes.any, | |
| onChange: React.PropTypes.func, |
| { | |
| "query": { | |
| "function_score": { | |
| "query": { | |
| "bool": { | |
| "must": { | |
| "multi_match": {"query": "Renaissance", "fields": ["name", "company"]}, | |
| "term": {"features": "disability_access"}, | |
| }, | |
| "should": { |
| # Nginx+Unicorn best-practices congifuration guide. Heartbleed fixed. | |
| # We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies. | |
| # Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module | |
| # | |
| # Deployment structure | |
| # | |
| # SERVER: | |
| # /etc/init.d/nginx (1. nginx) | |
| # /home/app/public_html/app_production/current (Capistrano directory) | |
| # |
| #!/usr/bin/env python2 | |
| # Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected]) | |
| # The author disclaims copyright to this source code. | |
| import sys | |
| import struct | |
| import socket | |
| import time | |
| import select |
| # Public: A module to be mixed in another class with common methods to index | |
| # records in ElasticSearch. | |
| # | |
| # The host object needs to respond to 'indexed_attributes', which will return | |
| # an array of the attributes names to be indexed. | |
| # | |
| # It's also recommended to override the 'save?' method to make sure only | |
| # records that match some specifications are indexed. | |
| # | |
| # The type used for the ElasticSearch index will be extracted from the name of |
| --colour | |
| -I app |