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 / 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 / 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 / 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."""
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;

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:

@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>
'use strict';
var models = require('../models');
const WorkOrder = models.fm_work_order;
const WorkOrderDetail = models.fm_work_order_detail;
const Sequence = models.md_sequence;
var Vehicle = models.fm_vehicle;
var Company = models.md_company;
var Branch = models.fn_branch;
const WorkOrderType = models.fm_workordertype;
var Schedule = models.fm_vehicle_schedule;
@hoangbits
hoangbits / changes
Created March 3, 2018 03:16
note bug 1109
remove:
[(ngModel)]="product.unit"
[(ngModel)]="product.shortDesc"
[(ngModel)]="product.currency"
chagnes in .ts file:
this.product.unit -> this.fg.controls['unit'].value)
this.product.shortDesc -> this.fg.controls['shortDesc'].value
this.product.currency -> this.fg.controls['currency'].value
@hoangbits
hoangbits / sequelize transaction await
Last active September 22, 2020 00:42
using await with transaction in sequelize ORM
// get transaction
const transaction = await sequelize.transaction();
try {
// step 1
await Model.destroy({where: {id}}, {transaction});
// step 2
await Model.create({}, {transaction});
// commit
@hoangbits
hoangbits / sg
Created October 3, 2017 09:06
FindJobs
TechinAsia
Wantedly
InternSG
Glints
Recruit.Net
e27
Google
https://github.com/hugo53/awesome-RemoteWork