Skip to content

Instantly share code, notes, and snippets.

View donhuvy's full-sized avatar

Vy Do donhuvy

  • Hanoi, Vietnam
  • 09:50 (UTC +07:00)
View GitHub Profile
@donhuvy
donhuvy / PYTHON_FUNDAMENTALS.md
Created May 7, 2024 15:24 — forked from mdang/PYTHON_FUNDAMENTALS.md
Python Fundamentals

Python Fundamentals

Variables

  • Variable names can only contain these characters:
    • Lowercase letters (a through z)
    • Uppercase letters (A through Z)
    • Digits (0 through 9)
    • Underscore (_)
  • Names cannot begin with a digit.
@donhuvy
donhuvy / RAILS_CHEATSHEET.md
Created May 7, 2024 15:21 — forked from mdang/RAILS_CHEATSHEET.md
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before

@donhuvy
donhuvy / gist:2f54917f1f5b3f0e1259901b08c88bb6
Created May 5, 2024 10:28 — forked from jesserundle/gist:4693541
Installing Ruby, Rails, and mysql gem on Windows
Install Ruby using rubyinstaller:
http://rubyinstaller.org/downloads/
install to the C drive to a folder without spaces, eg c:/Ruby193
Install RubyGems:
http://rubyforge.org/frs/?group_id=126
on command line do:
'gem install rails'
@donhuvy
donhuvy / gist:a5ff9d3dc06338b793e2face4dc2fb0b
Created April 9, 2024 08:32 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@donhuvy
donhuvy / Function.java
Created March 12, 2024 10:36 — forked from jreijn/Function.java
Read File from S3 in Java
public static final String TYPE_QUERY_PARAM = "type";
public static final String JSON_FILE_EXTENSION = ".json";
public static final String PAGE_PREFIX = "_p";
private S3Client s3Client = S3Client.builder()
.region(Region.EU_WEST_1)
.httpClient(UrlConnectionHttpClient.builder().build())
.credentialsProvider(EnvironmentVariableCredentialsProvider.create())
.build();
@donhuvy
donhuvy / secretsmanager.tf
Created January 19, 2024 08:53 — forked from anttu/secretsmanager.tf
Terraform AWS Secrets Manager example with key and value
resource "aws_secretsmanager_secret" "IRCSecrets" {
name = "irc/client/credentials"
description = "My IRC client credentials"
}
resource "aws_secretsmanager_secret_version" "IRCCredentials" {
secret_id = "${aws_secretsmanager_secret.IRCSecrets.id}"
secret_string = "{\"username\":\"AzureDiamond\",\"password\":\"hunter2\"}"
}
@donhuvy
donhuvy / ParseRSAKeys.java
Created July 24, 2023 04:08 — forked from destan/ParseRSAKeys.java
Parse RSA public and private key pair from string in Java
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
@donhuvy
donhuvy / Application.properties
Created June 3, 2023 13:07 — forked from Akashpatel579/Application.properties
Reactive CRUD APIs with Spring WebFlux
logging.level.org.springframework=ERROR
#logging.level.org.springframework=TRACE
logging.level.com=TRACE
server.port=8080
spring.data.mongodb.host=localhost
spring.data.mongodb.port=27017
spring.data.mongodb.database=testdb
wget -O /tmp/YaHei.Consolas.1.12.zip https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/uigroupcode/YaHei.Consolas.1.12.zip
unzip /tmp/YaHei.Consolas.1.12.zip
sudo mkdir -p /usr/share/fonts/consolas
sudo mv YaHei.Consolas.1.12.ttf /usr/share/fonts/consolas/
sudo chmod 644 /usr/share/fonts/consolas/YaHei.Consolas.1.12.ttf
cd /usr/share/fonts/consolas
sudo mkfontscale && sudo mkfontdir && sudo fc-cache -fv
@donhuvy
donhuvy / goGetPrivate.md
Created May 5, 2023 09:43 — forked from StevenACoffman/goGetPrivate.md
How to `go get` private repos using SSH key auth instead of password auth.

Set GOPRIVATE to match your github organization

Cloning the repo using one of the below techniques should correctly but you may still getting an unrecognized import error.

As it stands for Go v1.13, I found in the doc that we should use the GOPRIVATE variable like so:

GOPRIVATE=github.com/ORGANISATION_OR_USER_NAME go get -u -f github.com/ORGANISATION_OR_USER_NAME/REPO_NAME

The 'go env -w' command (see 'go help env') can be used to set these variables for future go command invocations.

How to go get private repos using SSH key auth instead of password auth.