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
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active May 6, 2024 13:21
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

@hariangr
hariangr / example.dart
Created June 5, 2019 13:31
Docked FloatingActionButton center with BottomNavigationBar
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
home: Scaffold(
@ckimrie
ckimrie / example.component.ts
Last active December 12, 2023 20:53
Example on how to achieve RxJS observable caching and storage in Angular 2+. Ideal for storing Http requests client side for offline usage.
import { Component, OnInit, OnDestroy } from '@angular/core';
import {Http} from "@angular/http";
import { LocalCacheService } from "./local-cache.service";
@Component({
selector: 'app-example',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class ExampleComponent implements OnInit, OnDestroy {
@aifarfa
aifarfa / angular fixed column XY scrollable table.markdown
Last active March 21, 2018 07:50
angular fixed column XY scrollable table

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.

@knownasilya
knownasilya / index.html
Last active November 6, 2023 18:45 — forked from Hagith/drawing-tools.html
Google Maps Advanced Drawing
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="UTF-8">
<title>Drawing Tools</title>
<script type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=false&libraries=drawing"></script>
<style type="text/css">
#map, html, body {
@mlynch
mlynch / autofocus.js
Last active August 24, 2022 15:03
AngularJS Autofocus directive
/**
* the HTML5 autofocus property can be finicky when it comes to dynamically loaded
* templates and such with AngularJS. Use this simple directive to
* tame this beast once and for all.
*
* Usage:
* <input type="text" autofocus>
*
* License: MIT
*/
@mrded
mrded / array.js
Created May 10, 2014 21:17
AngularJS: Delete an item or object from an array
var array = [];
var index = $scope.array.indexOf(item);
$scope.array.splice(index, 1);