Skip to content

Instantly share code, notes, and snippets.

View smitpatelx's full-sized avatar
🎯
Focusing

Smit Patel smitpatelx

🎯
Focusing
View GitHub Profile
@smitpatelx
smitpatelx / Educational OR Learning.md
Last active May 10, 2019 22:37
A mint of creativity
@smitpatelx
smitpatelx / lab1_php.md
Last active March 23, 2021 21:48
Lab1 Gist

LAB 1 - Basic XHTML Pages

General

You are to create two HTML pages with a common look and feel. These two pages will be uploaded to the course webserver (opentech.durhamcollege.org) using WinSCP. The pages must be visible from the server with a Web browser before they can be marked. Pages that are stored only on the local workstation disk drive cannot be viewed from any other system, and therefore cannot be marked.

For this assignment you should try to find a web resource that has a list and explains each of the XHTML 1.0 supported tags. As an example, here is a link to the W3Schools tag library (w3schools is an excellent website). Feel free to try and find your own.

The HTML pages must conform to the W3C XHTML 1.0 Transitional specification, as checked by the W3C validator.

@smitpatelx
smitpatelx / mongodb_cheat_sheet.md
Last active December 22, 2019 07:19 — forked from bradtraversy/mongodb_cheat_sheet.md
MongoDB Cheat Sheet

MongoDB Cheat Sheet

CMD

mongo //open shell
Ctrl + L //Clear Shell
Ctrl + C //Exit Shell

Show All Databases

@smitpatelx
smitpatelx / Wordpress Setup Permissions - Script
Created August 17, 2020 19:39
Setup Wordpress files & directory permissions
#!/bin/bash
#
#
WP_OWNER=user # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=/ # <-- wordpress root directory
WS_GROUP=www-data # <-- webserver group
# reset to safe defaults
find ${WP_ROOT} -exec chown ${WP_OWNER}:${WP_GROUP} {} \;
@smitpatelx
smitpatelx / FocusOutside.jsx
Created January 11, 2021 20:38
Wrapper for catching blur and click outside event. Useful while building dropdowns and many more!
import { useState } from "react";
const FocusOutside = ({clickedOutside, ...props})=>{
let _timeoutID;
const [IsManagingFocus, setIsManagingFocus] = useState(false);
const _onBlur = ()=>{
_timeoutID = setTimeout(() => {
import { useState } from "react";
import FocusOutside from '../../lib/FocusOutside'
const SelectCountry = (props)=>{
const [ShowMenu, setShowMenu] = useState(false)
const toogleMenu = ()=>{
setShowMenu(!ShowMenu)
}
@smitpatelx
smitpatelx / Dockerfile
Created March 3, 2021 21:02 — forked from ricog/Dockerfile
Docker wait for mysql to be ready and then load sql
FROM mysql:5.6
MAINTAINER Your Name <you@yourplace.com>
COPY wait-for-mysql.sh /
CMD /wait-for-mysql.sh