Skip to content

Instantly share code, notes, and snippets.

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

Manuel Bojato KingDarBoja

🏠
Working from home
View GitHub Profile
@KingDarBoja
KingDarBoja / reversed_countries.enum.ts
Last active January 13, 2022 22:55
TypeScript enum Country Codes ISO 3166 Alpha 3
/**
* Countries Enumerables based on [ISO 3166-1 Alpha2
* Code](https://www.iso.org/iso-3166-country-codes.html). These enumerables
* were converted into alpha3 codes based on https://www.iban.com/country-codes.
*/
export enum CountriesEnum {
AFG = 'Afghanistan',
ALA = 'Aland Islands',
ALB = 'Albania',
DZA = 'Algeria',
@KingDarBoja
KingDarBoja / webpack.common.ts
Created November 30, 2019 01:04
Sample Webpack Config files on typescript for ngx-charts with AOT
import webpack from 'webpack';
import { CleanWebpackPlugin } from 'clean-webpack-plugin';
import CopyWebpackPlugin from 'copy-webpack-plugin';
import { root } from './helpers';
const WebpackCommonConfig: webpack.Configuration = {
entry: {
polyfills: './app/polyfills.ts',
// vendor: './app/vendor.ts',
@KingDarBoja
KingDarBoja / webpack.config.ts
Created November 8, 2019 13:19
Basic example of webpack configuration file using Typescript for any ng-toolkit generated project.
// Work around for https://github.com/angular/angular-cli/issues/7200
import path from 'path';
import webpack from 'webpack';
const config: webpack.Configuration = {
mode: 'none',
entry: {
// This is our Express server for Dynamic universal
server: './server.ts',
@KingDarBoja
KingDarBoja / package.json
Created October 11, 2019 00:27
This is a custom webpack config by using Typescript for intellisense. It doesn't seems to work at all, everything compiles but if you laod the app, it will give you a error.
{
"name": "sample-app",
"version": "0.0.0",
"description": "",
"scripts": {
"start": "webpack-dev-server --config config/webpack.dev.ts",
"build:dev": "webpack --config config/webpack.dev.ts --display-error-details",
"build:prod": "rimraf prod && webpack --config config/webpack.prod.ts"
},
"dependencies": {
@KingDarBoja
KingDarBoja / main.dart
Created March 4, 2019 15:35
Main Dart file implementing the AuthGuard
import 'package:angular/angular.dart';
import 'package:web/app.component.template.dart' as ng;
import 'package:angular_router/angular_router.dart';
import 'package:web/guards/auth.guard.dart';
// Import the main.dart file to reference it within the program as “self”
import 'main.template.dart' as self;
const bool useHashLS = false;
// This section provides the Dependency Injector "routerProviders"
@KingDarBoja
KingDarBoja / auth.guard.dart
Created March 4, 2019 15:34
AuthGuard example in AngularDart
import 'package:angular_router/angular_router.dart';
import 'package:core/core.dart';
import 'package:web/src/routes.dart';
import 'package:web/src/route_paths.dart';
class AuthGuard implements RouterHook {
Router _router;
AuthenticationState _authBlocState;
set router(Router value) => _router = value;
@KingDarBoja
KingDarBoja / 1-hello.py
Created September 25, 2018 04:31
Custom hello world program with colorfull words in the terminal using colorama module.
# -*- coding: utf-8 -*-
"""Custom hello world by KingDarBoja.
Python script to output the classic 'hello world' message using colorama.
To install it, use 'pip install colorama' on the command line.
"""
# Import the colorama module
from random import randint