Skip to content

Instantly share code, notes, and snippets.

View rmorrise's full-sized avatar

Russell Morrisey rmorrise

  • Corporation Service Company
  • Wilmington, DE
View GitHub Profile
@jgable
jgable / sandbox-mocha.js
Created May 8, 2014 15:29
Sinon Sandbox Example
var sinon = require('sinon'),
Widget = require('../../widget');
describe('My widget', function () {
var sandbox;
beforeEach(function () {
// Create a sandbox for the test
sandbox = sinon.sandbox.create();
});
@amirgalor
amirgalor / templateLoader.js
Last active April 3, 2019 09:11 — forked from anonymous/templateLoader.js
Kendo UI - "Template Loader" - improved !
/**
This defines a Global object to serve loading external templates.
It handles multiple "Templates" (Or "Views") loading,
by operating on an array of JSON objects of type {path: "path to file", tag: "script's tag to attach to dom"}
This way-
you can load multiple templates, each with it's own tag so they can be referenced seperatly,
templates can be written in a much "cleaner" manner - as they are not wrapped by a "script" tag, IDE's will recognize the html.
@mankyKitty
mankyKitty / SolrQuerySyntaxPrimer.md
Last active July 12, 2024 12:29
The documentation around the basics of the Solr query syntax is terrible, this is an attempt to alleviate the doc-shock associated with trying to learn some fundamentals.

Solr Query Syntax Basics

This is a super basic beginners guide to Solr Lucene query syntax. We're going to cover running a straightforward query, as well as some of the more useful functionality such as filtering and creating facets. We'll point out some things you can't do and generally give you enough instruction so that you can get yourself into trouble.

For testing you need a REST client capable of sending requests to your Solr instance. Either RESTClient for Firefox or Postman for Chrome are good choices.

Misc

Request Specific Fields

To specify a list of fields to return instead of the default Solr response use fl and provide a comma delimited list of fields:

@berngp
berngp / MarshallerSpecSupport.groovy
Created April 14, 2011 17:53
Unit Testing Custom Object Marshallers with Spock in Grails
package org.osscripters.grails.common.web.converters.marshaller
import grails.plugin.spock.ControllerSpec
import org.codehaus.groovy.grails.support.MockApplicationContext
import org.codehaus.groovy.grails.web.converters.ConverterUtil
import org.codehaus.groovy.grails.web.converters.configuration.ConvertersConfigurationInitializer
import org.springframework.validation.Errors
import org.springframework.web.context.WebApplicationContext
/**