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
| { | |
| "exchangeRatesToUsd": { | |
| "latest": { | |
| "CZK": "21.43", | |
| "EUR": "0.94" | |
| }, | |
| "20170313": { | |
| "CZK": "21.42", | |
| "EUR": "0.94" | |
| } |
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
| // shorten invite link | |
| export let shortenLink = functions | |
| .database | |
| .ref('/groups/{groupId}/inviteLink') | |
| .onWrite(event => shortenInviteLink(event)); | |
| // Shortens invite link and saves it in place of the original long link. | |
| async function shortenInviteLink(event: Event<DeltaSnapshot>) | |
| { | |
| let link: string = event.data.val(); |
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
| dependencies: | |
| override: | |
| - npm install -g typescript | |
| - npm --prefix ./functions install ./functions | |
| compile: | |
| override: | |
| - tsc --p ./functions/tsconfig.json --watch false --sourceMap false | |
| test: |
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
| { | |
| "database": { | |
| "rules": "database.rules.bolt" | |
| }, | |
| "storage": { | |
| "rules": "storage.rules" | |
| } | |
| } |
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
| path /members/{group_id} { | |
| read() { hasReadPermission(group_id) } | |
| index() { "name" } | |
| path /{member_id} is Member { | |
| write() { hasWritePermission(group_id) } | |
| } | |
| } | |
| type Member { |
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
| "members": { | |
| "$group_id": { | |
| "$member_id": { | |
| ".validate": "newData.hasChildren(['active', 'defaultWeight', 'name'])", | |
| "active": { | |
| ".validate": "newData.isBoolean()" | |
| }, | |
| "bankAccount": { | |
| ".validate": "newData.isString() && (newData.val().length > 0 && newData.val().length <= 24)" | |
| }, |
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
| import * as mocha from 'mocha' | |
| import * as sinon from 'sinon' | |
| import * as admin from 'firebase-admin' | |
| import * as changes from '../changes' | |
| import { expect } from 'chai' | |
| import { Event } from 'firebase-functions'; | |
| import { DeltaSnapshot } from 'firebase-functions/lib/providers/database'; | |
| describe("Change", () => { | |
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
| namespace SettleUp.Localization.Resources | |
| { | |
| public class AppResources | |
| { | |
| // Resource manager for accessing the ResX resources | |
| public global::System.Resources.ResourceManager ResourceManager { | |
| get { | |
| if (object.ReferenceEquals(resourceMan, null)) { | |
| // notice the AppResource's full path - you will want to change this to suit you | |
| global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SettleUp.Localization.Resources.AppResources", typeof(AppResources).Assembly); |
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
| <Application | |
| xmlns:loc="using:SettleUp.Localization.Resources" | |
| ...> | |
| <Application.Resources> | |
| <loc:AppResources x:Key="Loc" /> | |
| </Application.Resources> | |
| ... | |
| </Application> |
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
| $languages = "fi", "de", "cs" #... other languages | |
| $folder = "temp" | |
| $headers = @{ Authorization = "Basic base64-encoded-credentials" } # set the authorize header | |
| $languages | foreach { | |
| $lng = $_ | |
| try { | |
| Invoke-WebRequest -uri "https://api.getlocalization.com/settle_up/api/translations/file/strings.xml/$lng/" -Headers $headers -OutFile "$folder/strings.$lng.xml" | |
| } | |
| catch { | |
| Write-Error "Couldn't fetch language file '$lng'" |