Skip to content

Instantly share code, notes, and snippets.

View erycamel's full-sized avatar
💭
I may be slow to respond.

Ery Camel erycamel

💭
I may be slow to respond.
View GitHub Profile
in your system-config.ts add the angular 2 vendor path to the map object:
const map: any = {
'@angular2-material': 'vendor/@angular2-material'
};
Then here's the tricky bit, the Packages object is empty const packages: any {}; (unless you have already installed some third party packages and added them, yours will be too). So we have to declare the material packages we want to use, we do this by creating a array of the package names
const materialPkgs[]: string[]= [
'core',
Here’s how to update your fork directly from GitHub (as shown in the video above):
1 Open your fork repository on GitHub.
2 Click on Pull Requests.
3 Click on New Pull Request. By default, GitHub will compare the original with your fork, and there shouldn’t be nothing to compare if you didn’t make any changes.
4 Click on switching the base (if no changes were made in the fork) or click Edit and switch the base manually. Now GitHub will compare your fork with the original, and you should see all the latest changes.
5 Click on Create to create a pull request for this comparison and assign a predictable name to your pull request (e.g., Update from original).
6 Click on Send pull request.
7 Scroll down and click Merge pull request and finally Confirm merge (If your fork didn’t have any changes, you will be able to merge it automatically).
1. Donwload & Install NodeJS
2. npm install -g angular-cli
3. ng new pertama --prefix Profas
4. ng build
5. ng serve
@erycamel
erycamel / Yii2 Framework - Multi FrontEnd
Last active February 8, 2019 08:45
Yii2 Framework - Multi FrontEnd
1. Go into profas\environments\dev\
2. Copy & Paste frontend in this folder and rename it to client.
3. Then go to profas\environments\prod\
4. Copy & Paste frontend in this folder and rename it to client.
5. Open profas\environments\index.php
Find 'Development' => [
'path' => 'dev',
'setWritable' => [
'backend/runtime',
'backend/web/assets',
CREATE DATABASE stkfifo;
USE stkfifo;
CREATE TABLE items (
id INT AUTO_INCREMENT PRIMARY KEY,
CODE VARCHAR(20) NOT NULL,
NAME VARCHAR(100) NOT NULL,
quantity_on_hand DECIMAL(10,2) NOT NULL DEFAULT 0,
remarks TEXT NULL
) ;
@erycamel
erycamel / gist:9a1a5ca7288f2d78a81b
Created January 10, 2016 16:43
YII2 Basic Template Admin LTE v2
Step 1 – Initialize your project - Create Yii2 Basic
php composer.phar global require "fxp/composer-asset-plugin:~1.1.1"
php composer.phar create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic basic
Step 2 – Install FontAwesome - composer.json
"FortAwesome/Font-Awesome": "*",
Step 3 – Create your FontAwesome asset bundle
To register the files, we are going to create an asset bundle named FontAwesomeAsset.php
and place it on frontend(backend)/assets with the following contents:
@erycamel
erycamel / gist:bb0e5653977d620e68ce
Last active March 11, 2021 11:12
Yii2 htaccess - How to hide frontend/web and backend/web COMPLETELY
Step 1
Create .htaccess file in root folder, i.e advanced/.htaccess and write below code.
---------------
Options +FollowSymlinks
RewriteEngine On
# deal with admin first
RewriteCond %{REQUEST_URI} ^/(admin) <------
RewriteRule ^admin/assets/(.*)$ backend/web/assets/$1 [L]
RewriteRule ^admin/css/(.*)$ backend/web/css/$1 [L]
@erycamel
erycamel / Yii2 Authenticating by Email Address
Last active February 8, 2019 08:44
Yii2 Authenticating by Email Address
Yii2 Authenticating by Email Address
how to authenticate to either a username or email entered into the Login form.
modify two things.
1. First modify the User model (found in /common/models/ for advanced template or /models in the basic template)
to have a new function as below:
---------------------------------------
/**
D:\xampp\mysql\bin>mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.16 MySQL Community Server (GPL)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
D:\xampp\mysql\bin>mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.5.16 MySQL Community Server (GPL)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.