Skip to content

Instantly share code, notes, and snippets.

View johnkingzy's full-sized avatar
🎯
Focusing

Kingsley Solomon johnkingzy

🎯
Focusing
View GitHub Profile
@johnkingzy
johnkingzy / firebase-snippet.js
Created October 18, 2020 04:50
Firebase/Firestore useful snippets
// delete all users from the auth console
module.exports.deleteUsers = async (req, res) => {
return admin
.auth()
.listUsers()
.then((result) => {
const markedForDelete = [];
result.users.forEach((user) => {
markedForDelete.push(user.uid);
@johnkingzy
johnkingzy / media-query.css
Created July 31, 2020 21:29 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@johnkingzy
johnkingzy / SomeComponent.tsx
Created July 12, 2020 02:16 — forked from PTKC/SomeComponent.tsx
Google Autocomplete Example with Ant Design
import { Card, Col, Divider, Form, Input, Row } from "antd";
import { LocationSearchInput } from "./location-search";
import { geocodeByAddress, getLatLng } from "react-places-autocomplete";
import { FormComponentProps } from "antd/lib/form/Form";
type Props = {} & FormComponentProps;
type State = {
address: string;
};
import React, { PureComponent } from 'react';
import { Button, } from 'antd';
// npm i jspdf
import jsPDF from 'jspdf'
// npm i jspdf-autotable
import 'jspdf-autotable';
export default class pdfGenerate extends PureComponent {
@johnkingzy
johnkingzy / countries.php
Created May 20, 2020 08:28 — forked from josephilipraja/countries.php
List of Countries with Country code & Telephone (Dial) Code as a PHP Array. Bonus: PHP function to list all Countries as HTML Select Tag Options with their 2 character Country code as values
<?php
$countryArray = array(
'AD'=>array('name'=>'ANDORRA','code'=>'376'),
'AE'=>array('name'=>'UNITED ARAB EMIRATES','code'=>'971'),
'AF'=>array('name'=>'AFGHANISTAN','code'=>'93'),
'AG'=>array('name'=>'ANTIGUA AND BARBUDA','code'=>'1268'),
'AI'=>array('name'=>'ANGUILLA','code'=>'1264'),
'AL'=>array('name'=>'ALBANIA','code'=>'355'),
'AM'=>array('name'=>'ARMENIA','code'=>'374'),
'AN'=>array('name'=>'NETHERLANDS ANTILLES','code'=>'599'),
const HOST_URL = process.env.BASE_URL || 'http://localhost:3000';
//const API_URL = process.env.BASE_API_URL || 'http://14.225.11.12:3030/api/client';
const API_URL = process.env.BASE_API_URL || 'http://localhost:3000';
const webpack = require("webpack");
module.exports = {
mode: 'spa',
@johnkingzy
johnkingzy / .htaccess
Created March 25, 2020 07:23
.htaccess for a Laravel project that needs to be deployed to a Shared Hosting platform
<IfModule mod_rewrite.c>
RewriteEngine On
##
## You may need to uncomment (remove #) the following line for some hosting environments,
## if you have installed to a subdirectory, enter the name here also.
## Example: for https://site.com enter: "/", for https://site.com/something enter: "/something/"
##
# RewriteBase /
@johnkingzy
johnkingzy / welcome.blade.php
Created March 25, 2020 06:15
welcome.blade.php with section identifier to replace scripts and css link
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Client</title>
<base href="/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
{{--angular styles begin--}}
{{--angular styles end--}}
@johnkingzy
johnkingzy / gulpfile.js
Last active March 25, 2020 07:16
Gulp file that automatically copies all assets from Angular dist folder to Laravel public folder for reference.
var gulp = require('gulp');
var rimraf = require('rimraf');
var fs = require('fs');
var cheerio = require('cheerio');
gulp.task('dist', function(done) {
//remove old dist files from laravel public folder
rimraf.sync('./../server/public/client');
@johnkingzy
johnkingzy / wp-config-debug.php
Created January 14, 2020 14:06 — forked from jrfnl/wp-config-debug.php
Code to add to wp-config.php to enhance information available for debugging.
<?php
/**
* == About this Gist ==
*
* Code to add to wp-config.php to enhance information available for debugging.
*
* You would typically add this code below the database, language and salt settings
*
* Oh.. and *do* make sure you change the path to the log file to a proper file path on your server (make sure it exists).
*