Skip to content

Instantly share code, notes, and snippets.

View sovannarithcheav's full-sized avatar
😁
The owner is still alive

Sovannarith Cheav sovannarithcheav

😁
The owner is still alive
View GitHub Profile
@sovannarithcheav
sovannarithcheav / QuarkusYubikeyResource.java
Last active September 1, 2022 07:46
Java gradle Yubikey Client with com.yubico:yubico-validation-client
package kh.sovannarith.info.yubikey.web;
import kh.sovannarith.info.yubikey.helper.Status;
import kh.sovannarith.info.yubikey.request.YubikeyRequest;
import kh.sovannarith.info.yubikey.service.YubikeyClient;
import javax.inject.Inject;
import javax.validation.Valid;
import javax.ws.rs.*;
import javax.ws.rs.core.Response;

Folder Structure

Please note

While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.

Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.

@sovannarithcheav
sovannarithcheav / readme.md
Created July 1, 2022 04:27
Getting started with Telegram Bot

Getting started with Telegram Bot

  • Sign up for Telegram using any application with a phone number (decide which phoneNumber u will use)
  • Log in to your Telegram core: https://my.telegram.org
  • Create a new Bot in Telegram using @BotFather and you’ll get response back along with API Token
    • Sample response

      Done! Congratulations on your new bot. You will find it at t.me/Notificationbot. You can now add a description, about section and profile picture for your bot, see /help for a list of commands. By the way, when you've finished creating your cool bot, ping our Bot Support if you want a better username for it. Just make sure the bot is fully operational before you do this.
      
fernando@fernando-Vostro-5470:~$ curl start.spring.io
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Initializr :: https://start.spring.io
@sovannarithcheav
sovannarithcheav / ansible-restart-server.yml
Created March 13, 2020 19:03
Using ansible to restart server :D
---
# to resart server
- hosts: localhost
tasks:
- name: run command cowsay
command: init 6
---
# Example read-write git checkout from github
- hosts: localhost
tasks:
- name: git clone public repository
git:
repo: https://github.com/sovannarithcheav/problem-solving-1.git
dest: /home/sovannarith/Desktop/problem-solving-1
public static int is235Array(int[] a) {
int divisibleCount = 0, inDivisibleCount = 0;
int[] divisionArr = {2, 3, 5};
int arrLength = a.length;
boolean isDivisible;
for (int i = 0; i < a.length; i++) {
isDivisible = false;
for (int j = 0; j < divisionArr.length; j++) {
## Options to set on the command line
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i console-setup/layoutcode string us
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
d-i netcfg/choose_interface select auto
d-i netcfg/wireless_wep string
// Java program to demonstrate lamda expressions to implement
// a user defined functional interface.
@FunctionalInterface
interface Square
{
int calculate(int x);
}
class Test
@sovannarithcheav
sovannarithcheav / function interface with lambda
Created October 24, 2019 04:21
function interface with lambda
// Java program to demonstrate Implementation of
// functional interface using lambda expressions
class Test
{
public static void main(String args[])
{
// lambda expression to create the object