"scripts": {
"clean": "rm -rf dist",
"dev:watch": "npm run clean && tsup --watch src/index.ts --onSuccess 'node dist/index.js'",
"build": "npm run clean && tsup"
}
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 axios, { AxiosRequestConfig, AxiosResponse } from 'axios'; | |
import AWS, { Route53, S3 } from 'aws-sdk'; | |
import { createHmac } from 'crypto'; | |
type ObjectLike = Record<string, unknown> | string | Error | unknown; | |
export type CognitoAuthToken = { | |
AuthenticationResult: { | |
IdToken: string; | |
}; | |
}; |
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
apiVersion: autoscaling/v2beta1 | |
kind: HorizontalPodAutoscaler | |
metadata: | |
name: <name_of_the_hpa> | |
namespace: default | |
spec: | |
maxReplicas: 1 | |
minReplicas: 1 | |
scaleTargetRef: | |
apiVersion: apps/v1 |
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
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 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
const axios = require('axios'); | |
async function getMembers() { | |
try { | |
const resp = await axios.default.get('https://api.github.com/orgs/<org_name>/members', { | |
headers: { | |
'Accept': "application/vnd.github.v3+json", | |
"Authorization": "Bearer <token>" | |
} | |
}); |
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
{"lastUpload":"2022-02-01T14:31:59.145Z","extensionVersion":"v3.4.3"} |
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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"log" | |
"github.com/tidwall/gjson" | |
) |
I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).
Use ssh keys and define host aliases in ssh config file (each alias for an account).
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
package main | |
import ( | |
"bytes" | |
"fmt" | |
"log" | |
"net" | |
"strconv" | |
"sync" | |
) |
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
use include_dir::{include_dir, Dir}; | |
use std::fs::create_dir_all; | |
use std::path::Path; | |
use std::{time, io::prelude::*}; | |
const PROJECT_DIR: Dir = include_dir!("./server"); | |
fn main() { | |
let now = time::Instant::now(); | |
let start_path = Path::new("temp"); |
NewerOlder