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
server = sinon.fakeServer.create() | |
server.autoRespond=true | |
server.respondWith("GET", /\/customer\/(\d+)/, (xhr, id) -> | |
xhr.respond( 200, { "Content-Type": "application/json" }, JSON.stringify(window.sampleCustomerJson )) | |
) |
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
class sp.collections.DogCollection extends Backbone.Collection | |
initialize: -> | |
@fetch() | |
setInterval(@fetchChanges, 15*1000) | |
model: sp.models.DogModel | |
url: '/dogs' |
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
# Define new module | |
angular.module('http-loading-interceptor') | |
# Add filter at request send time | |
.config(['$httpProvider', ($httpProvider) -> | |
interceptor = (data, headersGetter) -> | |
alert("loading...") | |
data | |
$httpProvider.defaults.transformRequest.push(interceptor) | |
]) |
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
angular.module('spinner', []) | |
.provider('spinner', () -> | |
@$get = () -> return null | |
@startSpinner = () -> | |
spinnerEl = $('<p id="spinner"></p>') | |
data = spinnerEl.data() | |
if (data.spinner) | |
data.spinner.stop() |
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
angular.module('http-loading-interceptor', ['spinner']) | |
.config(['$httpProvider', 'spinnerProvider', ($httpProvider, spinnerProvider) -> | |
interceptor = (data, headersGetter) -> | |
spinnerProvider.startSpinner() | |
data | |
$httpProvider.defaults.transformRequest.push(interceptor) | |
]) | |
.config(['$httpProvider', 'spinnerProvider', ($httpProvider, spinnerProvider) -> |
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
grails.config.locations = [ ] | |
grails.config.locations << "file:$userHome/.grails/app-prod.groovy" |
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
grails.config.locations = [ "classpath:Config-core-main.groovy", | |
"classpath:Config-core-logging.groovy", | |
"classpath:Config-core-sec.groovy" ] |
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
Closure paginate = { attrs -> | |
// define new prefix aware keys | |
def _sort = attrs.prefix? attrs.prefix +"_sort" : 'sort' | |
def _offset = attrs.prefix? attrs.prefix + "_offset" : "offset" | |
def _total = attrs.prefix? attrs.prefix + "_total" : "total" | |
def writer = out | |
if (attrs.total == null) { |
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
import org.codehaus.groovy.grails.plugins.PluginManagerHolder | |
... | |
def doWithConfig = { config -> | |
// Here we need to tell the database migrations plugin the change log is in the s5-core plugin | |
try { | |
def pluginManager = PluginManagerHolder.pluginManager | |
def plugin = pluginManager.getGrailsPlugin('s5-core') | |
def pluginDir = org.codehaus.groovy.grails.plugins.GrailsPluginUtils.getPluginDirForName('s5-core')?.path |
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
oauth: | |
client: | |
override: true | |
autoapprove: | |
- cf | |
clients: | |
cf: | |
override: true | |
authorized-grant-types: password,implicit | |
authorities: uaa.none |
OlderNewer