Skip to content

Instantly share code, notes, and snippets.

View allanphilipbarku's full-sized avatar

Allan Philip Barku allanphilipbarku

View GitHub Profile
@allanphilipbarku
allanphilipbarku / apache2_vhost_config_vuejs_dist
Last active June 30, 2020 16:15 — forked from 7rin0/apache2_vhost_config_vuejs_dist
VueJS: Apache with forced https and http2 / Nginx vhost config examples
<VirtualHost *:80>
Protocols h2 h2c http/1.1
ServerName vuejs.project-url.com
ServerAdmin webmaster@vuejs.project-url.com
DocumentRoot /var/www/html/projec-root-directory/dist/
<Directory "/var/www/html/projec-root-directory/dist/">
AllowOverride All
Options FollowSymLinks Multiviews Indexes
Require all granted
const actions = ()=>{
const functionA = ()=>{/*do sth*/}
const functionB = ()=>{/*do sth*/}
const functionC = ()=>{/*send log*/}
return new Map([
[/^guest_[1-4]$/,functionA],
[/^guest_5$/,functionB],
[/^guest_.*$/,functionC],
//...
])
const actions = ()=>{
const functionA = ()=>{/*do sth*/}
const functionB = ()=>{/*do sth*/}
return new Map([
[/^guest_[1-4]$/,functionA],
[/^guest_5$/,functionB],
//...
])
}
const actions = ()=>{
const functionA = ()=>{/*do sth*/}
const functionB = ()=>{/*do sth*/}
return new Map([
[{identity:'guest',status:1},functionA],
[{identity:'guest',status:2},functionA],
[{identity:'guest',status:3},functionA],
[{identity:'guest',status:4},functionA],
[{identity:'guest',status:5},functionB],
//...
const actions = new Map([
[{identity:'guest',status:1},()=>{/*do sth*/}],
[{identity:'guest',status:2},()=>{/*do sth*/}],
//...
])
const onButtonClick = (identity,status)=>{
let action = [...actions].filter(([key,value])=>(key.identity == identity && key.status == status))
action.forEach(([key,value])=>value.call(this))
}
const actions = new Map([
['guest_1', ()=>{/*do sth*/}],
['guest_2', ()=>{/*do sth*/}],
['guest_3', ()=>{/*do sth*/}],
['guest_4', ()=>{/*do sth*/}],
['guest_5', ()=>{/*do sth*/}],
['master_1', ()=>{/*do sth*/}],
['master_2', ()=>{/*do sth*/}],
['master_3', ()=>{/*do sth*/}],
['master_4', ()=>{/*do sth*/}],
const actions = new Map([
[1, ['processing','IndexPage']],
[2, ['fail','FailPage']],
[3, ['fail','FailPage']],
[4, ['success','SuccessPage']],
[5, ['cancel','CancelPage']],
['default', ['other','Index']]
])
const onButtonClick = (status)=>{
@allanphilipbarku
allanphilipbarku / Car.js
Created January 16, 2020 09:34 — forked from r3dm1ke/Car.js
Car class in ES5
// "class" declaration
function Car(make, model) {
this.make = make;
this.model = model;
}
// the start method
Car.prototype.start = function() {
console.log('vroom');
}
@allanphilipbarku
allanphilipbarku / Car.js
Created January 16, 2020 09:33 — forked from r3dm1ke/Car.js
Car class in ES6
class Car {
constructor(make, model) {
this.make = make;
this.model = model;
}
start() {
console.log('vroom');
}
@allanphilipbarku
allanphilipbarku / disable_aggregation.md
Created December 20, 2019 00:32 — forked from crittermike/disable_aggregation.md
Disabling CSS/JS aggregation via Drush in Drupal 7 and Drupal 8

Drupal 7

drush vset preprocess_css 0 --yes
drush vset preprocess_js 0 --yes

Drupal 8