Skip to content

Instantly share code, notes, and snippets.

@fadhlimajid
fadhlimajid / nginx.conf
Created August 2, 2018 11:27 — forked from mul14/nginx.conf
Nginx, PHP and CORS.
server {
listen 80;
server_name mydomain.com www.mydomain.com;
location / {
rewrite ^(.*)$ https://$server_name$1 permanent;
}
}
@fadhlimajid
fadhlimajid / oop-chaining.js
Last active April 7, 2018 07:26
OOP-Challenge 08.Chaining Method
const fs = require('fs')
class Cart{
constructor(file='./cart.txt'){
this.file = file
this.tempCart = []
}
addItem(items){
items.quantity ? items.quantity : items['quantity']=1
@fadhlimajid
fadhlimajid / majid-28.03.txt
Created March 29, 2018 03:23
mysql challenges on 28.03.2018
1.Update item price with SKU AROG-001 to 14000000.
UPDATE items SET price = 14000000 WHERE sku = 'AROG-001';
2.Find all users who have never logged in.
SELECT * FROM users WHERE created_at = updated_at;
3.Find all items that contains "mac".
mysql> SELECT * FROM items WHERE name LIKE '%Mac%';
4.Count all paid orders with SKU IPHX-001.