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
resource "google_project_iam_custom_role" "elastic-backup" { | |
role_id = "Custom-elastic-role" | |
title = "Elastic role" | |
description = "Role for serviceaccounts used by elastic-vms" | |
permissions = ["iam.serviceAccountKeys.get","storage.objects.get","storage.buckets.get","storage.buckets.create","storage.objects.create","storage.objects.list","storage.objects.delete"] | |
} | |
resource "google_project_iam_member" "elastic-backup" { | |
role = "projects/${var.project_name}/roles/Custom-elastic-role" | |
member = "serviceAccount:elastic-backup@${var.project_name}.iam.gserviceaccount.com" |
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
project_name = "my-project" | |
region = "europe-west1" | |
region_zone_c = "europe-west1-c" | |
region_zone_d = "europe-west1-d" | |
machine_type = "n1-standard-2" // Min req for ES | |
machine_type_medium = "e2-medium" // for Kibana | |
network_tags = ["my-special-tag"] | |
kibana_tags = ["kibana-tag","http-server","https-server"] | |
ports_to_open = ["80","9200","443","9300","3000"]. // for loadbalancer | |
machine_access_scopes = ["cloud-platform","userinfo-email", "compute-ro", "storage-rw", "monitoring-write", "logging-write", "https://www.googleapis.com/auth/trace.append"] |
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
resource "google_compute_instance" "my-elastic-kibana" { | |
name = "my-elastic-kibana" | |
machine_type = var.machine_type_medium | |
zone = var.region_zone_d | |
tags = var.kibana_tags | |
allow_stopping_for_update = true | |
boot_disk { | |
initialize_params { | |
image = var.gce_image | |
size = 100 |
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
resource "google_compute_instance" "elastic-instance-1" { | |
name = "elastic-instance-1" | |
machine_type = var.machine_type | |
zone = var.region_zone_d | |
allow_stopping_for_update = true | |
tags = var.network_tags | |
boot_disk { | |
initialize_params { | |
image = var.gce_image | |
size = 200 |
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
// Transaction for atomic execution into all tables | |
database.runTransaction(async (err, transaction) => { | |
if (err) { | |
console.error("Error running transaction: " + err); | |
return; | |
} | |
if (profileExists) { | |
const deleted = await deleteProfile(retailUnit, partyUId, transaction); | |
console.log(`Deleted customer ${deleted} ${partyUId}`); |
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 android.Manifest; | |
import android.content.Context; | |
import android.content.pm.PackageManager; | |
import android.os.Bundle; | |
import android.support.annotation.NonNull; | |
import android.support.v4.app.Fragment; | |
import android.support.v4.app.FragmentManager; | |
import android.support.v4.content.ContextCompat; | |
import android.util.Log; |
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
// info.plist | |
// AppDelegate | |
import FBSDKCoreKit | |
import FBSDKShareKit | |
import FBSDKLoginKit | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
// Override point for customization after application launch. | |
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 CoreData | |
var people: [NSManagedObject] = [] | |
func deleteFromCD() | |
{ | |
guard let appDelegate = | |
UIApplication.shared.delegate as? AppDelegate else { | |
return | |
} |
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
// Userdefaults group | |
let defaults = UserDefaults(suiteName: "group.sharing")! | |
if(defaults.object(forKey: "sharedUrl") != nil) | |
{ | |
urlLabel.text = defaults.string(forKey: "sharedUrl") | |
} | |
// Share | |
@IBAction func letsShare(_ sender: AnyObject) { |
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
class ViewController: UIViewController, SKProductsRequestDelegate, SKPaymentTransactionObserver { | |
let productIdentifiers = Set(["20diamonds", "premium"]) | |
var productsArray = Array<SKProduct>() | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view, typically from a nib. | |