This file contains 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
/* | |
* Copyright (C) 2012 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains 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
/* | |
This example shows how you can use your data structure as a basis for | |
your Firebase security rules to implement role-based security. We store | |
each user by their Twitter uid, and use the following simplistic approach | |
for user roles: | |
0 - GUEST | |
10 - USER | |
20 - MODERATOR |
This file contains 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
sudo kill $(sudo lsof -t -i:8000) # kill process on port 8000 |
This file contains 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
// get our folding cell | |
final FoldingCell foldingCell = (FoldingCell) findViewById(R.id.folding_cell); | |
// set custom parameters | |
foldingCell.initialize(1000, Color.DKGRAY, 2); | |
// or with camera height parameter | |
foldingCell.initialize(cameraHeight, animationDuration, backSideColor, additionalFlipCounts); | |
foldingCell.initialize(1000, Color.DKGRAY, 0); |
This file contains 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
<h2>Child Component</h2> | |
<label>Enter value</label> | |
<input type="text" #childText (keyup)="onChange(childText.value)"> | |
<p>Value from Parent Component: {{parentData}}</p> |
This file contains 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 {Injectable} from '@angular/core'; | |
import {FirebaseAuth, AngularFire} from "angularfire2"; | |
import {Subject, Observable, BehaviorSubject} from "rxjs"; | |
import {AuthInfo} from "./auth-info"; | |
@Injectable() | |
export class AuthService { | |
static UNKNOWN_USER = new AuthInfo(null); | |
authInfo$: BehaviorSubject<AuthInfo> = new BehaviorSubject<AuthInfo>(AuthService.UNKNOWN_USER); |
This file contains 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 main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
) | |
type Fruits map[string]int |
This file contains 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 main | |
import ( | |
"crypto/aes" | |
"crypto/cipher" | |
"crypto/rand" | |
"encoding/base64" | |
"fmt" | |
"io" | |
) |
This file contains 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
// https://stackoverflow.com/questions/40006631/sending-post-request-in-golang-with-header | |
package main | |
import ( | |
"fmt" | |
"net/http" | |
"crypto/tls" | |
) | |
func main() { |
This file contains 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
#!/bin/bash | |
go test -coverprofile=coverage.out | |
go tool cover -html=coverage.out |