Skip to content

Instantly share code, notes, and snippets.

View keidarcy's full-sized avatar
🧙‍♂️
making something

Xing Yahao keidarcy

🧙‍♂️
making something
View GitHub Profile
@keidarcy
keidarcy / install.sh
Last active January 10, 2024 06:50
Install `e1s` in AWS CloudShell
#!/usr/bin/env bash
set -eu
version="1.0.11"
download_dir="$HOME/e1s_downloads/${version}"
bin_dir="$HOME/.local/bin"
[ ! -d "$download_dir" ] && mkdir -p "$download_dir"
@keidarcy
keidarcy / README.md
Last active January 6, 2023 00:06
Amazon Linux 2 - nginx/httpd

Nginx

user data

  user_data = <<-EOL
		#!/bin/bash
		sudo amazon-linux-extras install nginx1
    sudo systemctl start nginx
    sudo systemctl status nginx
@keidarcy
keidarcy / 1_simple.go
Created January 1, 2023 11:06 — forked from sosedoff/1_simple.go
Golang Custom Struct Tags Example
package main
import (
"fmt"
"reflect"
)
// Name of the struct tag used in examples
const tagName = "validate"
@keidarcy
keidarcy / README.md
Created December 19, 2022 08:50
Minimum setup to create new mongodb database programmatically

command

node index.js test1

node index.js test2

result

@keidarcy
keidarcy / README.md
Last active September 22, 2022 02:31
Todos
  • NPM scripts CLI.
    • Save script information in package.scripts.json in root.
    • Every script item contains script key, script value, script description, script updated time, script author, script memo.
  • Item can add, edit, remove, list in CLI.
@keidarcy
keidarcy / wifi-password.sh
Created May 2, 2022 04:36
find current wifi-password in mac
#!/usr/bin/env sh
# https://github.com/rauchg/wifi-password
version="0.1.0"
# locate airport(1)
airport="/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport"
if [ ! -f $airport ]; then
echo "ERROR: Can't find \`airport\` CLI program at \"$airport\"."
exit 1
@keidarcy
keidarcy / apple.ts
Last active September 30, 2024 23:46
`Sign in with Apple` Nodejs typescript full example sample code
import axios from 'axios';
import * as jwt from 'jsonwebtoken';
import * as jwksClient from 'jwks-rsa';
import jwtDecode, { JwtHeader } from 'jwt-decode';
/**
* @see {@link https://github.com/expo/expo/blob/sdk-44/packages/expo-apple-authentication/src/AppleAuthentication.types.ts#L147}
* An object representing the tokenized portions of the user's full name. Any of all of the fields
* may be `null`. Only applicable fields that the user has allowed your app to access will be nonnull.
*/
@keidarcy
keidarcy / node.js
Created March 17, 2022 02:18 — forked from Roman2K/node.js
Ruby/node encryption/decryption
const crypto = require('crypto');
const PASSWORD = "098f6bcd4621d373cade4e832627b4f6"
, MESSAGE = 'test';
function InvalidSignatureError() {
Error.captureStackTrace(this, this.constructor);
}
function encipher(message, password, callback) {
@keidarcy
keidarcy / educative-student-pack.md
Created February 12, 2022 04:46
Educative Student Pack included courses
Title author level
JavaScript Fundamentals Before Learning React Robin Wieruch beginner
Software Design Patterns: Best Practices for Software Developers C. H. Afzal beginner
Modern C++ Concurrency: Get the most out of any machine Rainer Grimm advanced
Intermediate JavaScript: Building Frontend Components Educative intermediate
C++ Standard Library including C++ 14 & C++ 17 Rainer Grimm beginner
Complete JavaScript Course: Build a Real World App from Scratch Baptiste Pesquet beginner
An Introduction to Programming in Go Educative beginner
C++17 in Detail: A Deep Dive Bartłomiej Filipek beginner