Skip to content

Instantly share code, notes, and snippets.

View riyastir's full-sized avatar
🏠
Working from home

Mohamed Riyas riyastir

🏠
Working from home
View GitHub Profile
@riyastir
riyastir / index.js
Created August 22, 2021 21:55
Working Class Component
import React, { Component } from "react";
import ReactDOM from "react-dom";
import PropTypes from "prop-types";
import ScrollMenu from "react-horizontal-scrolling-menu";
import "./styles.css";
let list = [
{ name: "item1" },
{ name: "item2" },
{ name: "item3" },
@riyastir
riyastir / App.js
Created August 22, 2021 21:54
App Component
import React, { useState } from "react";
import ScrollMenu from "react-horizontal-scrolling-menu";
import "./App.css";
let list = [
{ name: "item1" },
{ name: "item2" },
{ name: "item3" },
{ name: "item4" },
{ name: "item5" },
@riyastir
riyastir / DUN.js
Created August 20, 2021 21:05
dun
import React, { useEffect, useState } from "react";
import AdUnit from "../AdUnit";
import NavList from "../NavList";
import Footer from "../theme/Footer";
import Header from "../theme/Header";
import Chart from "react-apexcharts";
import OwlCarousel from "react-owl-carousel";
import "owl.carousel/dist/assets/owl.carousel.css";
import "owl.carousel/dist/assets/owl.theme.default.css";
import TabPanel from "../TabPanel";
@riyastir
riyastir / parties.json
Created August 12, 2021 11:38
Parties
{
"parties": [
"BEBAS",
"BERJAYA",
"BN",
"DAP",
"MOMOGUN",
"NASMA",
"PAS",
"PASOK",
@riyastir
riyastir / index.js
Created August 12, 2021 11:16
State issue - Redux
const [candidateParties, setCandidateParties] = useState([]);
const dispatch = useDispatch();
const currentParty = useSelector(currentSelectedParty);
useEffect(() => {
(async () => {
await fetch(`http://localhost:3000/api/v1/candidates/parties`)
.then((res) => res.json())
.then((result) => {
setCandidateParties(result.parties);
@riyastir
riyastir / dummy
Created July 16, 2021 14:27
example
{
"debug": {
"currentTime": "19:52:39",
"currentDay": "FRI"
},
"data": [{
"main_category": "Near by Shops",
"store_category_id": 1,
"store_category_name": "Stores",
"stores": [{
export const AuthContext = React.createContext();
const [state, dispatch] = React.useReducer(
(prevState, action) => {
switch (action.type) {
case "RESTORE_TOKEN":
return {
...prevState,
userToken: action.token,
isLoading: false,
};
@riyastir
riyastir / huawei_devices_without_gms.js
Created June 10, 2021 15:20
List of Huawei Devices without GMS services (Useful for Useragent detection)
let huaweiDevices = [
"WGR-W09",
"WGR-W19",
"WGR-AN19",
"MRR-W29",
"BRQ-AN00",
"OCE-AN50",
"ANA-AL00",
"TET-AN00",
"BRQ-AN00",
@riyastir
riyastir / designer.html
Last active August 29, 2015 14:17
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../topeka-elements/avatars.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../paper-item/paper-item.html">
<link rel="import" href="../topeka-elements/topeka-datasource.html">
<polymer-element name="my-element">