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
connectRule.use(function (req) { | |
if(typeof req.user !== 'undefined'){ | |
req.user.role.active.contains('admin', function(found) { | |
console.log("Something was found "+found); | |
return found; | |
}) | |
} | |
else{ | |
return false; | |
} |
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
package com.test.itext; | |
import java.util.Arrays; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; | |
import org.springframework.context.ApplicationContext; | |
import org.springframework.context.annotation.ComponentScan; | |
import org.springframework.context.annotation.Configuration; | |
@Configuration |
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
package com.gleason.itext; | |
import java.util.Arrays; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; | |
import org.springframework.boot.builder.SpringApplicationBuilder; | |
import org.springframework.boot.context.web.SpringBootServletInitializer; | |
import org.springframework.context.annotation.ComponentScan; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.web.bind.annotation.PathVariable; |
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
<g:set var="myarray" value="[accountId: accountInfo.id,location: i]" /> | |
<a href="${createLink(controller:'billingPreferences', action:'preferences', params:myarray)}">${it?.name?:" "}</a> |
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
package com.gleason.itext; | |
import java.util.Arrays; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; | |
import org.springframework.boot.builder.SpringApplicationBuilder; | |
import org.springframework.boot.context.web.SpringBootServletInitializer; | |
import org.springframework.context.annotation.ComponentScan; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.web.bind.annotation.PathVariable; |
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
scope.roundETD = function(etd){ | |
var start = (etd - scope.currentDate.now())/360000; | |
var fixed = start.toFixed(3); | |
var rounded = Math.round(fixed) | |
return Number(rounded+"e-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
function Animal(name) { | |
this.legs = []; | |
this.name = name; | |
console.log("Running Constructor " + name); | |
} | |
Animal.prototype.sayHello = function() { | |
var message = "Hello my name is " + this.name + " and I have " + this.legs.length + " legs" | |
return message; | |
} | |
function Dog(name) { |
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
cf.save().success(function (cf) { | |
request(app) | |
.post('/crowdfunding/sendConfirmationEmail') | |
.send({ | |
'id': cf.id, | |
'text': 'test text' | |
}) | |
.end(function (err, res) { | |
assert.equal('PENDING', cf.state); | |
t.rollback(); |
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
app = angular.module('plunker') | |
var test = "test" | |
app.run(function($rootScope){ | |
$scope = $roowScope.$new(); | |
$scope.test = test; | |
$scope.$watch('test' function(){ | |
//Do something | |
}); | |
}); |
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
export default Ember.Route.extend({ | |
model: function(){ | |
var adapter = AddressBookAdapter.create(); | |
return new Promise(function(resolve, reject) { | |
var promise = adapter.findAll(); | |
promise.then(function(response){ | |
resolve(response.data) | |
}); | |
}); | |
} |