Skip to content

Instantly share code, notes, and snippets.

View samuraitruong's full-sized avatar

Truong Nguyen samuraitruong

View GitHub Profile
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
class Program
{
static void Main()
function tableToCSV(table) {
let rows = table.querySelectorAll('tr');
let csv = [];
// Iterate through rows
rows.forEach((row) => {
let csvRow = [];
let cells = row.querySelectorAll('td, th');
// Iterate through cells
@samuraitruong
samuraitruong / dummy.txt
Last active December 19, 2023 23:33
dummy
public static byte[] GenerateRandomBytes(int length)
{
// Create a byte array to hold the random values.
byte[] randomBytes = new byte[length];
// Create a new instance of the RNGCryptoServiceProvider.
using (RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider())
{
// Fill the byte array with random bytes generated by RNGCryptoServiceProvider.
rng.GetBytes(randomBytes);
@samuraitruong
samuraitruong / clone-all.sh
Last active September 20, 2023 23:47
gcloud-clone-all
#!/bin/bash
# Get the currently configured project from gcloud
CURRENT_PROJECT=$(gcloud config get-value project)
# Check if a project ID argument is provided, otherwise use the current project
PROJECT_ID="${1:-$CURRENT_PROJECT}"
# Ensure that a project ID is set
if [ -z "$PROJECT_ID" ]; then
This file has been truncated, but you can view the full file.
[
{
"id": 11409,
"name": "Tarot",
"symbol": "TAROT",
"slug": "tarot",
"tags": [],
"cmcRank": 6233,
"marketPairCount": 1,
"circulatingSupply": 0,
Implement RestAPI server to allow you retrieve DVCH VN
## Database provided
- Mongo DB
mongodb+srv://user_ro:<password>@cluster0-b0cl8.gcp.mongodb.net/dvch?retryWrites=true&w=majority
- password: o7vv7XCpbHwJxwVW
This user is readonly user. it can't insert or update or delete any data from above database
set e
s3_folder=s3://you-bucker/your-folder
sftp=user@IP:/FOLDER/
GPG_KEY_NAME="GPG_KEY_NAME";
rm -rf ./encrypted ./csvs ./zip
aws s3 cp $s3_folder ./csvs --recursive
mkdir ./zip || true
[
"fun",
"people",
"outside",
"lot",
"boat",
"footy",
"bear",
"dead",
"special",
TOKEN=[you git hub token]
ORG=[you ORG name]
curl -s https://$TOKEN:@api.github.com/orgs/$ORG/repos?per_page=200 | \
grep -ioE "\"ssh_url\": \"(.*)\"" | cut -d '"' -f4 |\
xargs -n 1 git clone