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
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
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
@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
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
const cacheName = 'v1'; | |
const cacheAssets = [ | |
'index.html', | |
'about.html', | |
'/css/style.css', | |
'/js/main.js' | |
]; | |
// Call Install Event |
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
const express = require('express') | |
const app = express() | |
const bcrypt = require('bcrypt') | |
const mongoose = require('mongoose') | |
var bodyParser = require('body-parser') | |
app.use(bodyParser.json()) | |
mongoose.connect('mongodb://localhost/my_database', { |
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 app = express() | |
const bcrypt = require('bcrypt') | |
var bodyParser = require('body-parser') | |
app.use(bodyParser.json()) | |
const users = [ ] |
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
{ | |
"src": "^/service-worker.js$", | |
"dest": "/_next/static/service-worker.js", | |
"headers": { | |
"cache-control": "public, max-age=43200, immutable", | |
"Service-Worker-Allowed": "/" | |
} | |
} |