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
// usage: log('inside coolFunc', this, arguments); | |
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/ | |
window.log = function(){ | |
log.history = log.history || []; // store logs to an array for reference | |
log.history.push(arguments); | |
if(this.console) { | |
arguments.callee = arguments.callee.caller; | |
var newarr = [].slice.call(arguments); | |
(typeof console.log === 'object' ? log.apply.call(console.log, console, newarr) : console.log.apply(console, newarr)); | |
} |
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
hitTool = new paper.Tool(); | |
hitTool.activate(); | |
hitTool.onMouseDown = function (event) { | |
hitOptions = { | |
segments: true, | |
stroke: true, | |
fill: true, | |
tolerance: 5 | |
}; | |
hitResult = paper.project.hitTest(event.point, hitOptions); |
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
Chat = { | |
video: { | |
apiKey: 1935341, | |
subscribers: {}, | |
publisherProps: { | |
width: 100, | |
height: 80, | |
name: tbMyName | |
}, | |
subscriberProps: { |
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
$(document).ready( function() { | |
var chatSession = <?=json_encode($tokbox)?> | |
, connected = 0 | |
, session = null | |
, isPublishing = 0 | |
, publisher = null | |
, numStreams = 0 | |
, subscribers = {} | |
, publisherProps = {width: 100, height:80, name:tbMyName} | |
, subscriberProps = {width: 100, height:80}; |
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 lastDrawing; | |
function save() { | |
var paths = []; | |
var path = paper.project.activeLayer.firstChild; | |
while (path) { | |
// store | |
segments = []; | |
foreach ( segment in path.segments ) { |
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
val users = Await.result(ComponentRegistry.institutionUserDao.tableScan, 100.seconds) | |
users map { u => | |
u.phoneNumber map { phoneNum => | |
if (phoneNum.number.contains("region")) { | |
println("--") | |
println("fixing user") | |
println(u) | |
Await.result(ComponentRegistry.institutionUserService.update(u.copy(phoneNumber = None)), 5.seconds) | |
Thread.sleep(100) | |
} |
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
search.cloudsearch.SearchDomains.cloudSearchAsync.truncate(search.UserDomain) | |
search.cloudsearch.SearchDomains.defineIndexFields(search.UserDomain) | |
search.cloudsearch.SearchDomains.startIndexing(search.UserDomain) | |
Await.result(ComponentRegistry.institutionDao.tableScan flatMap(ComponentRegistry.userSearch.seed), 1000 seconds) |
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
val sections = Await.result(ComponentRegistry.sectionDao.tableScan, 100.seconds) | |
sections map { section => | |
val sectionId = section.getIdOrFail | |
val userSections = Await.result(ComponentRegistry.userSectionService.findInstructorsBySectionId(sectionId), 100.seconds) | |
val instructorIds = userSections.map( _.userId ).distinct | |
val allInstructors = Await.result(ComponentRegistry.institutionUserService.findByIds(instructorIds, section.institutionId), 100.seconds) | |
val instructors = allInstructors.filter(!_.isInactive) | |
instructors.find(_.getIdOrFail == section.instructorId) getOrElse { | |
println("--") | |
println("broken section") |
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
val institution = Await.result(ComponentRegistry.institutionService.fetchById("8b5fc2a9-9055-46bc-9a83-1ff8c00b004a"), 10.seconds) | |
Await.result(ComponentRegistry.sectionEnrollmentService.enroll(institution, "74ee7c8f-f854-4b3e-8210-f13714e7110c", "14d3dca8-e277-415e-93f7-1601d6b9ec03", models.UserSectionRole.Instructor), 100.seconds) |
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
package migrations | |
import global.{ComponentRegistry, DaoRegistry} | |
import com.amazonaws.services.dynamodbv2.model.AttributeValue | |
import java.net.URI | |
import scala.concurrent.Await | |
import scala.concurrent.duration._ | |
object SlideUriMigration extends DatabaseMigration with DaoRegistry { |
OlderNewer