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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: friday | |
annotations: | |
author: Francesco Donzello | |
spec: | |
selector: | |
matchLabels: | |
app: friday |
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
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
labels: | |
k8s-app: metrics-server | |
name: metrics-server | |
namespace: kube-system | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRole |
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 {ChangeDetectionStrategy, Component, OnInit} from '@angular/core'; | |
import {UserTypes} from '../../../models/models'; | |
@Component({ | |
selector: 'app-my-home', | |
template: ` | |
This is visible to Admin, User and Guest. | |
<app-if-granted [allowedRoles]="[userTypes.Admin, userTypes.User]"> | |
<!-- This is visible only to Admin and 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
import {Component, Input, OnInit} from '@angular/core'; | |
import {UserTypes} from '../../models/models'; | |
import {UserService} from '../../api/user.service'; | |
import {map} from 'rxjs/operators'; | |
@Component({ | |
selector: 'app-if-granted', | |
template: ` | |
<ng-container *ngIf="isGranted() | async"> | |
<ng-content></ng-content> |
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 "fmt" | |
func main() { | |
i := 0 | |
i++ | |
if i > 0 { | |
fmt.Println("i greater than 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
#!/bin/sh | |
sudo apt update | |
sudo apt install -y curl docker.io | |
sudo setfacl --modify user:$(whoami):rw /var/run/docker.sock | |
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v1.6.2/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/ | |
sudo minikube start --vm-driver=none | |
alias minikube="sudo minikube" |
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
{ | |
"users": [ | |
{ | |
"id": 1, | |
"firstname": "Alan", | |
"lastname": "Sorrenti", | |
"email": "[email protected]" | |
} | |
], | |
"news": [ |
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
{ | |
"results": [ | |
{ | |
"id": 132579, | |
"day": 21, | |
"redaction_id": 2, | |
"player_id": 157, | |
"player_name": "H. Kane", | |
"played": true, | |
"arbitrary": false, |
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
{ | |
"articles": [ | |
{ | |
"id": 1, | |
"title": "Belgium beers are awesome", | |
"description": "oh yeah, awesome oh yeah, awesome oh yeah, awesome oh yeah, awesome oh yeah, awesome oh yeah, awesome oh yeah, awesome oh yeah, awesome oh yeah, awesome oh yeah, awesome oh yeah, awesome oh yeah, awesome oh yeah, awesome oh yeah, awesome oh yeah, awesome oh yeah, awesome oh yeah, awesome oh yeah, awesome oh yeah, awesome oh yeah, awesome oh yeah, awesome oh yeah, awesome oh yeah, awesome oh yeah, awesome oh yeah, awesome oh yeah, awesome oh yeah, awesome oh yeah, awesome oh yeah, awesome oh yeah, awesome ", | |
"date": "2016-04-19T18:03:40.887", | |
"author": "francesco" | |
}, | |
{ |
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
var sqlite3 = require("sqlite3").verbose(); | |
var db = new sqlite3.Database("db"); | |
db.serialize(function () { | |
db.run( | |
"CREATE TABLE IF NOT EXISTS users (name TEXT, password TEXT, role TEXT)" | |
); | |
db.run( | |
"INSERT INTO users (name, password, role) VALUES (?, ?, ?)", | |
"admin", |
NewerOlder