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
private Image scaleImage(Image sourceImage, int newImageWidth, int newImageHeight){ | |
// width of original source image | |
int srcWidth = sourceImage.getWidth(); | |
// height of original source image | |
int srcHeight = sourceImage.getHeight(); | |
// An array for RGB, with the size of original image) | |
int rgbSource[] = new int[srcWidth*srcHeight]; | |
// An array for RGB, with the size of scaled image) |
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
for /f "delims=" %a in ('npm bin') do @set NODEBINPATH=%a | |
set PATH=%PATH%;%nodebinpath% |
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
// construct function copied from | |
// http://stackoverflow.com/questions/1606797/use-of-apply-with-new-operator-is-this-possible/#1608546 | |
function construct(constructor, args) { | |
function F() { | |
return constructor.apply(this, args); | |
} | |
F.prototype = constructor.prototype; | |
return new F(); | |
} |
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 downloadPDF(expenseClaim) { | |
var payload = JSON.stringify( expenseClaim ); | |
var input = $("<input />").attr('type', 'hidden').attr('name', 'json').attr('value', payload); | |
var form = $("<form />").attr('method', 'POST').attr('action', context+'/generatepdf2'); | |
form.append(input); | |
form.submit(); | |
} | |
pdfCommandS.subscribe(downloadPDF); |
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 notEmpty(val) { | |
return !_.isEmpty(val); | |
} | |
function valueAndValidFrom(observable, validator) { | |
validator = validator || notEmpty; | |
return { | |
valueS: observable.filter(validator), | |
validS: observable.map(validator) | |
}; |
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 strip-units($number) { | |
@return $number / ($number * 0 + 1); | |
} | |
@function rem($x, $fallback:false){ | |
@if type-of($x) != "number" or $x == 0 { | |
@return $x; | |
} @else { |
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
About the data delay: | |
https://support.google.com/analytics/answer/1009219?hl=en |
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 the version from Backbone AMD repository: | |
// https://github.com/amdjs/backbone |
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 deepCopy = function (value) { | |
return JSON.parse(JSON.stringify(value)); | |
}; | |
var omitAttributes = function (obj) { | |
var copy = deepCopy(obj); | |
var keys = Array.prototype.slice.call(arguments, 1); | |
function omitIfFound(obj, parts) { | |
if (parts.length > 0 && obj[parts[0]]) { |
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
// Defining colors =========================================== | |
$color-names : ''; | |
$light-colors : ''; | |
$dark-colors : ''; | |
@mixin define-theme-color( $color-name, $light-color, $dark-color ) { | |
@if ($color-names != "") and (index($color-names, $color-name) != false) { |
OlderNewer