Skip to content

Instantly share code, notes, and snippets.

View penguinbroker's full-sized avatar

Dave Lee penguinbroker

  • Geneva Technologies, Inc
  • New York, NY
View GitHub Profile
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)
@penguinbroker
penguinbroker / gist:6b88ed887f6dd168298f
Created January 22, 2015 23:52
clear bad phone numbers
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)
}
var lastDrawing;
function save() {
var paths = [];
var path = paper.project.activeLayer.firstChild;
while (path) {
// store
segments = [];
foreach ( segment in path.segments ) {
$(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};
@penguinbroker
penguinbroker / VideoChat.js
Created December 20, 2011 18:36
TokBox integrated chat lib
Chat = {
video: {
apiKey: 1935341,
subscribers: {},
publisherProps: {
width: 100,
height: 80,
name: tbMyName
},
subscriberProps: {
@penguinbroker
penguinbroker / gist:1378258
Created November 19, 2011 01:15
Paper.js hit test
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);
@penguinbroker
penguinbroker / log.js
Created November 17, 2011 07:51
Paul Irish's logging solution
// 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));
}