Skip to content

Instantly share code, notes, and snippets.

View tieppt's full-sized avatar

Tiep Phan tieppt

View GitHub Profile
@tieppt
tieppt / config.h
Last active June 25, 2024 05:54
GMMK Pro & QMK: support Rotary Knob, VIA, turn off RGB when host is suspended, caps lock/scroll lock/num lock led and more
// path: ./keyboards/gmmk/pro/ansi/keymaps/viapro/config.h
#pragma once
#ifdef RGB_MATRIX_ENABLE
#define RGB_DISABLE_WHEN_USB_SUSPENDED true
#define RGB_DISABLE_TIMEOUT 900000 // 15 minutes (15 * 60 * 1000ms)
// Effects
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS // Heatmap, Rain
#define RGB_MATRIX_KEYPRESSES // REACTIVE, SPLASH modes
@tieppt
tieppt / config.h
Last active March 26, 2023 02:46
GMMK Pro & QMK: support Rotary Knob, VIA, turn off RGB when host is suspended
// path: qmk_firmware/keyboards/gmmk/pro/ansi/keymaps/viapro/config.h
#pragma once
#ifdef RGB_MATRIX_ENABLE
#define RGB_DISABLE_WHEN_USB_SUSPENDED true
#endif // RGB_MATRIX_ENABLE
@tieppt
tieppt / angular.json
Last active February 11, 2023 06:18
Angular v12 configuration file - angular.json - for ng serve with development by default
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"configurations": {
"production": {
"budgets": [
],
"outputHashing": "all"
},
"development": {
@tieppt
tieppt / nginx.conf
Created June 2, 2020 05:22
Angular Nginx Conf
server {
## port
listen 80;
## Your website name goes here.
server_name example.com;
## Your only path reference.
root /var/www/example.com/public_html;
## This should be in your http block and if it is, it's not needed here.
@tieppt
tieppt / tsconfig-paths-bootstrap.js
Created March 22, 2020 16:46
tsconfig paths for nodejs app with custom paths
const tsConfig = require('./tsconfig.json');
const tsConfigPaths = require('tsconfig-paths');
const path = require('path');
const outDir = path.normalize(tsConfig.compilerOptions.outDir);
const rootDir = path.normalize(tsConfig.compilerOptions.rootDir);
const baseUrl = path.join(__dirname, tsConfig.compilerOptions.baseUrl);
let paths = tsConfig.compilerOptions.paths;
import {ConnectionPositionPair} from '@angular/cdk/overlay';
export const POSITION_MAP: { [key: string]: ConnectionPositionPair } = {
top: new ConnectionPositionPair(
{ originX: 'center', originY: 'top' },
{ overlayX: 'center', overlayY: 'bottom' }
),
topCenter: new ConnectionPositionPair(
{ originX: 'center', originY: 'top' },
{ overlayX: 'center', overlayY: 'bottom' }
const express = require('express');
const path = require('path');
const app = express();
// Serve only the static files form the dist directory
app.use(express.static(__dirname + '/dist/<name-of-app>'));
app.get('/*', (req, res) => {
res.sendFile(path.join(__dirname + '/dist/<name-of-app>/index.html'));
server {
listen 80;
server_name http://abc.com;
root /path/to/your/app;
# eg. root /var/www/html/abc-app/dist
import { Injectable } from '@angular/core';
import {
HttpHandler,
HttpProgressEvent,
HttpInterceptor,
HttpSentEvent,
HttpHeaderResponse,
HttpUserEvent,
HttpRequest,
HttpResponse
@tieppt
tieppt / routing.module.ts
Created November 12, 2017 14:41
routing
export const routes: Routes = [
{
path: 'login',
component: LoginComponent
}, {
path: 'register',
component: RegisterComponent
}, {
path: '',
children: [