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 { EMoonPhase, EMoonPhaseName, MOON_PHASE_NAMES, moonPhase } | |
const { round, trunc: truncate } = Math | |
enum EMoonPhase { | |
New = 0, | |
WaxingCrescent, |
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 get(path, obj, fb = `$\{${path}}`) { | |
return path.split('.').reduce((res, key) => res[key] || fb, obj); | |
} | |
function parseTpl(template, map, fallback) { | |
return template.replace(/\$\{.+?}/g, (match) => { | |
const path = match.substr(2, match.length - 3).trim(); | |
return get(path, map, fallback); | |
}); | |
} |
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
/** | |
* An extension over google's servingUrl "cdn" features: https://developers.google.com/appengine/docs/java/images/ | |
* | |
* It links to the Media datastore object and also provides rectangular cropping. | |
* | |
* Examples: | |
* /c/i/69589306 | |
* /c/i/69589306=s300 | |
* /c/i/69589306=s300-c | |
* /c/i/69589306=s300-c=h20 |
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.yumyumlabs.web.filter; | |
import com.google.appengine.api.labs.modules.ModulesService; | |
import com.google.appengine.api.labs.modules.ModulesServiceFactory; | |
import com.google.appengine.api.utils.SystemProperty; | |
import javax.servlet.*; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
import java.io.ByteArrayOutputStream; |