Skip to content

Instantly share code, notes, and snippets.

View waqasajaz's full-sized avatar

Waqas Ajaz waqasajaz

View GitHub Profile
<?php
require_once('config.php');
include_once 'verify_utils.php';
$shopify = $_GET;
$shop_url = $shopify['shop'];
$shop_name = get_shop_name($shop_url, '', '.myshopify.com');
//check if app is already install or not
import React from "react";
import styled from "@emotion/styled";
import { NavLink } from "react-router-dom";
import { Helmet } from "react-helmet-async";
import {
CardContent,
Accordion,
AccordionDetails,
AccordionSummary,
import type { HttpContextContract } from "@ioc:Adonis/Core/HttpContext";
import { chatTypes } from "App/Enums/ChatTypeEunm";
import ChathistorySourceLog from "App/Models/ChathistorySourceLog";
import {
chatDetails,
createChat,
deleteChat,
deleteUserChats,
getChatHistory,
populateChatRequestId,
@waqasajaz
waqasajaz / hooks.js
Created July 24, 2019 09:54
React Hooks Example
import { useState, useEffect, useRef } from 'react';
// Let's pretend this <Counter> component is expensive to re-render so ...
// ... we wrap with React.memo, but we're still seeing performance issues :/
// So we add useWhyDidYouUpdate and check our console to see what's going on.
const Counter = React.memo(props => {
useWhyDidYouUpdate('Counter', props);
return <div style={props.style}>{props.count}</div>;
});
@waqasajaz
waqasajaz / array_flatter.js
Created March 29, 2017 07:41
Flat the nested array
function flatter(data) {
var result = [];
for (var i = 0; i < data.length; i++) {
if(Array.isArray(data[i])) {
result = result.concat(flatten(data[i]));
} else {
result.push(data[i]);
}
}
return result;