Skip to content

Instantly share code, notes, and snippets.

View hoangbits's full-sized avatar
🏝️
Working from earth

Le Gia Hoang hoangbits

🏝️
Working from earth
View GitHub Profile
@hoangbits
hoangbits / hotelListFeed.xml
Created January 30, 2019 02:53
hotel-list-feed
<?xml version="1.0" encoding="UTF-8"?>
<listings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.gstatic.com/localfeed/local_feed.xsd">
<language>jp</language>
<listing>
<id>25107</id>
<name>カンデオホテルズ大阪なんば</name>
<address format="simple">
<component name="addr1">中央区東心斎橋2-2-5</component>
<component name="city">大阪市</component>

Keybase proof

I hereby claim:

  • I am legiahoang on github.
  • I am legiahoang (https://keybase.io/legiahoang) on keybase.
  • I have a public key ASAstFepVJ2jLmR9J3od6rNDYW-7ghFpzQCvZLUDDSaooQo

To claim this, I am signing this object:

import { Component, OnInit } from '@angular/core';
import { AgRendererComponent } from "ag-grid-angular/main";
import { ICellRendererParams } from "ag-grid-community";
@Component({
selector: 'app-ag-grid-material-checkbox-cell',
template: `<mat-checkbox (change)="toggleSelection($event)"></mat-checkbox>`
})
export class AgGridMaterialCheckboxCellComponent implements OnInit, AgRendererComponent {
private params: ICellRendererParams;
@hoangbits
hoangbits / Fibonancci.py
Created January 9, 2020 05:38
a let b move forward first
def sum_two_numbers(a, b):
return a + b # return result to the function caller
c = sum_two_numbers(3, 12) # assign result of function execution to variable 'c'
def fib(n):
"""This is documentation string for function. It'll be available by fib.__doc__()
Return a list containing the Fibonacci series up to n."""
@hoangbits
hoangbits / webpack.config.js
Created March 11, 2021 08:56
typescript, scss module react webpackt
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const LinkTypePlugin = require("html-webpack-link-type-plugin")
.HtmlWebpackLinkTypePlugin;
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer")
.BundleAnalyzerPlugin;
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const CopyPlugin = require("copy-webpack-plugin");
const Dotenv = require("dotenv-webpack");
@hoangbits
hoangbits / nginx.conf
Last active April 2, 2021 11:29
nginx reverse config
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
# multi_accept on;
}
@hoangbits
hoangbits / gen.sh
Last active April 4, 2021 04:45
generate ECDSA (ES384)
# ref:
# https://wiki.openssl.org/index.php/Command_Line_Elliptic_Curve_Operations
# https://stackoverflow.com/questions/15686821/generate-ec-keypair-from-openssl-command-line
# openssl ec help
# 1.1 generate private key in EC format:
openssl ecparam -name secp384r1 -genkey -noout -out auth-private.ec.key
# 1.2 convert EC format to a non-encrypted PKCS8 format:
openssl pkcs8 -topk8 -nocrypt -in auth-private.ec.key -out auth-private.pem
pylint --rcfile=.pylintrc backend/**/*.py -r y
import React from "react";
import logo from "./logo.svg";
import { useState } from "react";
import "./App.css";
function App() {
const [number, setNumber] = useState();
const highestPrime = (num: number) => {
for (let i = num; i > 2; i--) {
@hoangbits
hoangbits / UserListBulkAction.tsx
Created June 1, 2021 23:09
useObservableState
import * as React from "react";
import { FC, useEffect } from "react";
import { BulkDeleteButton, BulkExportButton, Loading } from "react-admin";
import { useSelector } from "react-redux";
import { useQuery } from "react-query";
import { reservationAPI } from "@/api";
import { ReservationStatus } from "@/utils/typing/reservation";
import { GetListResult } from "ra-core/esm/types";
import { forkJoin, from, Observable, of } from "rxjs";
import { csDataProvider, User } from "@/utils";