This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const cacheName = 'v2'; | |
// Call Install Event | |
self.addEventListener('install', e => { | |
console.log('Service Worker: Installed'); | |
}); | |
// Call Activate Event | |
self.addEventListener('activate', e => { | |
console.log('Service Worker: Activated'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: make sure to change the settings from line 4-9 | |
set dbUser=root | |
set dbPassword="" | |
set backupDir="F:\supersami" | |
set mysqldump="C:\xampp\mysql\bin\mysqldump.exe" | |
set mysqlDataDir="C:\xampp\mysql\data" | |
set zip="C:\Program Files\7-Zip\7z.exe" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import actionTypes from '../constant' | |
// Actions. | |
export const addTodo = (data) => ({ type : "S_"+actionTypes.ADD_TODO , payload : data }) | |
export const getTodo = () => ({type : actionTypes.GET_TODO }) | |
export const deleteTodo = (id) => ({type : actionTypes.DELETE_TODO , payload : id }) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MatchArrOnStrings = ({ | |
arr: ['red', 'blue', 'green'], | |
string: 'We have a red and blue and green Thingies', | |
}) => { | |
const a = arr; | |
const b = string; | |
const reg = new RegExp(a.join('|'), 'g'); | |
const c = b.match(reg); | |
return c.length == a.length; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setNativeValue(element, value) { | |
const elem = document.querySelector(element); | |
try { | |
const valueSetter = Object.getOwnPropertyDescriptor(elem, "value").set; | |
const prototype = Object.getPrototypeOf(elem); | |
const prototypeValueSetter = Object.getOwnPropertyDescriptor( | |
prototype, | |
"value" | |
).set; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logo from "./logo.svg"; | |
import "./App.css"; | |
import { useEffect, useRef, useState } from "react"; | |
function App() { | |
const [state, setstate] = useState(40); | |
const dot1 = useRef(); | |
const dot2 = useRef(); | |
const dot3 = useRef(); | |
const container = useRef(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logo from "./logo.svg"; | |
import "./App.css"; | |
import { useEffect, useRef, useState } from "react"; | |
function App() { | |
const [state, setstate] = useState(40); | |
useEffect(() => {}, []); | |
return ( | |
<div className="Splash"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:root { | |
--color: #1c1821; | |
} | |
.Splash { | |
margin: 0; | |
padding: 0; | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
height: 100vh; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import | |
import { getDvaApp } from 'umi' | |
// DVA store. | |
const store = getDvaApp()?._store | |
// function, this is how you can access dispatch | |
export function dispatch(action) { | |
return getDvaApp()?._store.dispatch(action); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require("express"); | |
const next = require("next"); | |
const port = process.env.PORT || 3000; | |
const dev = true; | |
const app = next({ dev }); | |
const handle = app.getRequestHandler(); | |
app | |
.prepare() |