- Gen key
$ gpg --full-gen-key
- List
$ gpg --list-keys
- Export pub key
#!/bin/bash | |
# CF | |
aws cloudformation deploy --template-file template.yaml --stack-name Ec2Ssh --parameter-overrides file://params.json | |
aws cloudformation delete-stack --stack-name Ec2Ssh | |
# ECR | |
aws ecr get-login-password --region region | docker login --username AWS --password-stdin aws_account_id.dkr.ecr.region.amazonaws.com | |
docker tag hello-world:latest aws_account_id.dkr.ecr.region.amazonaws.com/hello-repository | |
docker push aws_account_id.dkr.ecr.region.amazonaws.com/hello-repository |
import React, { useState, useEffect } from 'react'; | |
import { DataTable, Box, Text, Button, TextInput, Select } from 'grommet'; | |
import { ChevronLeft, ChevronRight } from './Icons'; | |
import { intArr } from '../utils/functions'; | |
const PaginatedTable: React.FC<{ [key: string]: any }> = props => { | |
const { pageSize, data } = props; | |
const [currentPage, changeCurrentPage] = useState(0); | |
const [currentPageSize, changeCurrentPageSize] = useState(pageSize); |
import scala.math.Ordering.{String => StringOrdering} | |
import scala.collection.Searching._ | |
import scala.util.Sorting | |
implicit class Search[A, LS](val coll: LS)(implicit ls2idxseq: LS => IndexedSeq[A]) { | |
def binarySearch[B >: A](elem: B, from: Int = 0, to: Int = coll.length) | |
(implicit ord: Ordering[B]): SearchResult = { | |
if (to == from) InsertionPoint(from) else { | |
val idx = from + (to - from - 1) / 2 | |
math.signum(ord.compare(elem, coll(idx))) match { |
# images | |
docker images -f dangling=true -q --no-trunc | xargs docker rmi | |
# containers | |
docker container ls -a -f status=exited -q --no-trunc | grep "search_container" | grep -v 'CONTAINER' | awk '{print $1}' | xargs docker container rm | |
# volumes | |
docker volume ls -qf dangling=true | xargs -r docker volume rm | |
# network |
module BST where | |
import Data.List | |
data Tree a = EmptyTree | Node a (Tree a) (Tree a) deriving (Show, Read, Eq) | |
unitTree :: a -> Tree a | |
unitTree x = Node x EmptyTree EmptyTree | |
treeAdd :: (Ord a) => a -> Tree a -> Tree a |
class Base extends Object { | |
public baseProp: string | |
constructor() { | |
super(); | |
this.baseProp = 'b'; | |
} | |
} | |
class Derived extends Base { | |
public derivedProp: string |
<? | |
$claims = [ | |
'exp' => JWTFactory::getTTL(), | |
'a' => $a, | |
'b' => $b, | |
'now' => \Carbon\Carbon::now()->toDateTimeString(), | |
]; | |
$factory = JWTFactory::customClaims($claims); | |
$payload = $factory->make(); |