Skip to content

Instantly share code, notes, and snippets.

View lihourchhin's full-sized avatar
🎯
Focusing

Lihour lihourchhin

🎯
Focusing
View GitHub Profile
@lihourchhin
lihourchhin / load_dotenv.sh
Created October 2, 2021 05:18 — forked from mihow/load_dotenv.sh
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
@lihourchhin
lihourchhin / MessengerChat.js
Created August 14, 2021 04:13
Facebook Messenger Chat Plugin with NextJS
import React, { Component } from 'react'
import PropTypes from 'prop-types'
/**
* Utils
*/
const removeElementByIds = ids => {
ids.forEach(id => {
const element = document.getElementById(id)
if (element && element.parentNode) {

Bitcoin: A Peer-to-Peer Electronic Cash Systern

Satoshi Nakamoto
satoshin@gmx.com
www.bitcoin.org

Abstract. A purely peer-to-peer version of electronic cash would allow online payments to be sent directly from one party to another without going through a financial institution. Digital signatures provide part of the solution, but the main

@lihourchhin
lihourchhin / chmodr.sh
Created January 16, 2021 04:37 — forked from francisbyrne/chmodr.sh
Recursive chmod script for dirs and/or files
#!/bin/sh
#
# chmodr.sh
#
# author: Francis Byrne
# date: 2011/02/12
#
# Generic Script for recursively setting permissions for directories and files
# to defined or default permissions using chmod.
#
@lihourchhin
lihourchhin / fetch_data_in_react.js
Created November 2, 2020 01:41 — forked from mittalyashu/fetch_data_in_react.js
Fetch Data From RSS Feed In React
class FetchDataFromRSSFeed extends Component {
constructor() {
super();
this.state = {
recentBlogPost: {
name: '',
url: ''
}
}
}
@lihourchhin
lihourchhin / FactoryTests.kt
Created October 13, 2020 05:39 — forked from sombochea/FactoryTests.kt
Simple Factory Pattern on Kotlin
package com.cubetiqs.factory
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
class FactoryTests {
@Test
fun factoryTest() {
val carA = CarFactory(CarType.CAR_A).getCar()
@lihourchhin
lihourchhin / FactoryTests.kt
Created October 13, 2020 05:39 — forked from sombochea/FactoryTests.kt
Simple Factory Pattern on Kotlin
package com.cubetiqs.factory
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
class FactoryTests {
@Test
fun factoryTest() {
val carA = CarFactory(CarType.CAR_A).getCar()
@lihourchhin
lihourchhin / node_nginx_ssl.md
Created June 28, 2020 19:18 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

void main() {
// performe async & await
perform();
// synchronize
sTask1();
sTask2();
sTask3();
// asynchronize