Skip to content

Instantly share code, notes, and snippets.

View bezysoftware's full-sized avatar

Tomas Bezouska bezysoftware

  • Step Up Labs, Inc.
  • Prague
View GitHub Profile
{
"exchangeRatesToUsd": {
"latest": {
"CZK": "21.43",
"EUR": "0.94"
},
"20170313": {
"CZK": "21.42",
"EUR": "0.94"
}
dependencies:
override:
- npm install -g typescript
- npm --prefix ./functions install ./functions
compile:
override:
- tsc --p ./functions/tsconfig.json --watch false --sourceMap false
test:
{
"database": {
"rules": "database.rules.bolt"
},
"storage": {
"rules": "storage.rules"
}
}
path /members/{group_id} {
read() { hasReadPermission(group_id) }
index() { "name" }
path /{member_id} is Member {
write() { hasWritePermission(group_id) }
}
}
type Member {
"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)"
},
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", () => {
@bezysoftware
bezysoftware / resx-designer-sample.cs
Last active September 9, 2018 08:12
Resx designer sample
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);
@bezysoftware
bezysoftware / resx-binding-sample.xaml
Created September 6, 2018 09:10
Resx binding sample
<Application
xmlns:loc="using:SettleUp.Localization.Resources"
...>
<Application.Resources>
<loc:AppResources x:Key="Loc" />
</Application.Resources>
...
</Application>
@bezysoftware
bezysoftware / download-strings-getlocalization.ps1
Last active September 6, 2018 09:33
Download strings from getlocalition.com
$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'"