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 () { | |
window.Templates = { | |
templateX: Handlebars.compile("<div>{{ foo }}</div>"); | |
} | |
})(); |
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
'use strict'; | |
angular.module('angularApp') | |
.directive('cmInclude', ['$http', '$templateCache', '$anchorScroll', '$compile', | |
function($http, $templateCache, $anchorScroll, $compile) { | |
return { | |
restrict: 'ECA', | |
terminal: true, | |
compile: function(element, attr) { | |
var srcExp = attr.ngInclude || attr.src, |
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
def uploadPart(bucket: Bucket, uploadTicket: BucketFileUploadTicket, bucketFilePart: BucketFilePart): Future[BucketFilePartUploadTicket] = { | |
require(bucketFilePart.partNumber > 0, "The partNumber must be greater than 0") | |
require(bucketFilePart.partNumber < 10001, "The partNumber must be lesser than 10001") | |
// A hack way to get access to private httpUrl method | |
val url = bucket.s3.url(bucket.name, uploadTicket.name, 0).split('?')(0) | |
val uploadPart = bucket.s3.awsWithSigner | |
.url(url) | |
.withQueryString( | |
"partNumber" -> bucketFilePart.partNumber.toString, |
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 actions | |
import play.api.Play | |
import play.api.Play.current | |
import play.api.mvc._ | |
import scala.concurrent.Future | |
object HttpsAction extends ActionBuilder[Request] with Results { | |
def invokeBlock[A](request: Request[A], block: (Request[A]) => Future[Result]) = { |
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 controllers | |
object Users extends Controller { | |
def add = HttpsAction { | |
implicit request => Ok | |
} | |
} |
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
var iterationsData; | |
var results = document.getElementById('results'); | |
(function () { | |
if (!('localStorage' in window)) { | |
results.innerHTML = 'Your browser has no localStorage support.'; | |
return; | |
} |
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
if (localStorage && !localStorage.getItem('size')) { | |
var i = 0; | |
try { | |
// Test up to 10 MB | |
for (i = 250; i <= 10000; i += 250) { | |
localStorage.setItem('test', new Array((i * 1024) + 1).join('a')); | |
} | |
} catch (e) { | |
localStorage.removeItem('test'); | |
localStorage.setItem('size', i - 250); |
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
select decode(replace('45774962-e6f7-41f6-b940-72ef63fa1943'::text, '-', ''), 'hex'); | |
-- And here's how to convert it to the ShortUUID format used in Process Street | |
select replace(encode(substring(decode(replace('45774962-e6f7-41f6-b940-72ef63fa1943'::text, '-', ''), 'hex') from 9 for 8) || | |
substring(decode(replace('45774962-e6f7-41f6-b940-72ef63fa1943'::text, '-', ''), 'hex') from 1 for 8), 'base64'), '=', ''); |
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
'use strict'; | |
angular.module('frontStreetApp.directives') | |
.directive('psDatetimePicker', function (moment) { | |
var format = 'MM/DD/YYYY hh:mm A'; | |
return { | |
restrict: 'A', | |
require: 'ngModel', | |
link: function (scope, element, attributes, ctrl) { |
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
<!-- The dueDate field is a UNIX offset of the date --> | |
<input type="text" | |
ng-model="dueDate" | |
ps-datetime-picker | |
class="form-control"> |
OlderNewer