Skip to content

Instantly share code, notes, and snippets.

View sokhomhuy's full-sized avatar
🏠
Working from home

Huy Sokhom sokhomhuy

🏠
Working from home
  • Phnom Penh
View GitHub Profile
dotnet restore => restore nuget
dotnet build => build project
dotnet run => run project
dotnet ef migrations add "migration name" => add new migration
dotnet ef migrations remove => remove migration
dotnet ef database update => update-database migration
dotnet ef migrations list => view all migration list
dotnet ef database update "NameOfYourMigration" => revert migration by specific name
@sokhomhuy
sokhomhuy / node_nginx_ssl.md
Created December 8, 2021 02:07 — 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

export class ItemsComponent implements OnInit {
testing: Array<inventory>;
ngOnInit() {
this.testing = [
new inventory({
accountName: '',
accountCode: '',
items: [
new item({
@sokhomhuy
sokhomhuy / Custom ngInit in Angular 2+
Last active June 14, 2018 03:38
Custom ngInit in Angular 2+
import { Directive, Output, EventEmitter, Input, SimpleChange } from '@angular/core';
@Directive({
selector: '[ngInit]'
})
**export class NgInit {
@Output() ngInit: EventEmitter<any> = new EventEmitter<any>();
constructor() { }
ngOnInit() {
@sokhomhuy
sokhomhuy / set default value of string length
Last active April 11, 2018 09:15
Laravel 5.5: Specified key was too long error
As outlined in the Migrations guide to fix this all you have to do is edit your
AppServiceProvider.php file and inside the boot method set a default string length:
=> app->Providers->AppServiceProvider.php
use Illuminate\Support\Facades\Schema;
public function boot()
{
@sokhomhuy
sokhomhuy / Laravel : The page has expired due to inactivity. Please refresh and try again.
Created April 11, 2018 09:12
Laravel : The page has expired due to inactivity. Please refresh and try again.
please check this out by update app->Exceptions->Handler.php
public function render($request, Exception $exception)
{
if ($exception instanceof \Illuminate\Session\TokenMismatchException)
{
return redirect()
->back()
->withInput($request->except('password'))
->with([
@sokhomhuy
sokhomhuy / this package requires php ^7.1.3 but your PHP
Last active April 9, 2018 16:15
Laravel Configuration for some error
if we face the problem for install composer like something what ever..
This package requires php ^7.1.3 but your PHP version (7.0.10) does not satisfy that requirement.
....................
<b>Resolve: </b> => update composer.json with add new line in config object key: "platform": {"php": "you php version"}

angular fixed column XY scrollable table

sample directive: table content is scrollable both horizontal / vertical while table header and first column is fixed position.

cross browser tested on: IE8-11, Chrome, FF

A Pen by Pasit R. on CodePen.