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 / CURL-cheatsheet.md
Created September 24, 2021 20:25 — forked from joshuapekera/CURL-cheatsheet.md
CURL Cheatsheet
  • XML GET
curl -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET "http://hostname/resource"
  • JSON GET
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET "http://hostname/resource"
  • JSON PUT
@johnkingzy
johnkingzy / manual-gzip-howto-and-test.html
Created December 16, 2020 15:51 — forked from osvik/manual-gzip-howto-and-test.html
How to manually gzip CSS and JS files and serve them with Apache
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Manually gzip CSS and JS files</title>
<link rel="stylesheet" href="bootstrap-custom.min.css" type="text/css">
<script src="header-scripts.min.js"></script>
</head>
@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 / 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).
*
@johnkingzy
johnkingzy / git_empty_branch
Created February 20, 2018 03:43 — forked from j8/git_empty_branch
Create new branch with empty folder structure
You can create a new empty branch like this:
$ git checkout --orphan NEWBRANCH
--orphan creates a new branch, but it starts without any commit. After running the above command you are on a new branch "NEWBRANCH", and the first commit you create from this state will start a new history without any ancestry.
The --orphan command keeps the index and the working tree files intact in order to make it convenient for creating a new history whose trees resemble the ones from the original branch.
Since you want to create a new empty branch that has nothing to do with the original branch, you can delete all files in the new working directory:
@johnkingzy
johnkingzy / getdates.js
Last active February 19, 2018 22:31 — forked from miguelmota/getDates.js
Get dates in between two dates with JavaScript.
// Returns an array of dates between the two dates
var getDates = function(startDate, endDate) {
var dates = [],
currentDate = startDate,
addDays = function(days) {
var date = new Date(this.valueOf());
date.setDate(date.getDate() + days);
return date;
};
while (currentDate <= endDate) {