This file contains hidden or 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 * as actionTypes from '../actions/actionTypes'; | |
| export default (state = [], action) => { | |
| switch (action.type){ | |
| case actionTypes.CREATE_NEW_TODO: | |
| return [ | |
| ...state, | |
| Object.assign({}, action.todo) | |
| ]; |
This file contains hidden or 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 * as actionTypes from './actionTypes'; | |
| export const createToDo = (todo) => { | |
| return { | |
| type: actionTypes.CREATE_NEW_TODO, | |
| todo: todo | |
| } | |
| }; | |
| export const deleteToDo = (id) => { |
This file contains hidden or 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
| <html> | |
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> | |
| <body> | |
| <input id = "numInp"></input> | |
| <button>Calculate Square</button> | |
| <p class = "output">Enter a number</p> | |
| </body> | |
| <script> |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <title>Test Site</title> | |
| <!-- Global site tag (gtag.js) - Google Analytics --> | |
| <script async src="https://www.googletagmanager.com/gtag/js?id=G-QKXXXXXX"></script> | |
| <script> | |
| window.dataLayer = window.dataLayer || []; | |
| function gtag(){dataLayer.push(arguments);} | |
| gtag('js', new Date()); |
This file contains hidden or 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
| // Window Load Event | |
| window.addEventListener('load', () => { | |
| registerWorker(); | |
| }); | |
| // Register Worker Function | |
| async function registerWorker() { | |
| if ('serviceWorker' in navigator) { | |
| try { | |
| await navigator |
This file contains hidden or 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
| var staticCacheName = "hello-pwa"; | |
| self.addEventListener("install", function (e) { | |
| e.waitUntil( | |
| caches.open(staticCacheName).then(function (cache) { | |
| return cache.addAll(["/"]); | |
| }) | |
| ); | |
| }); | |
This file contains hidden or 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
| { | |
| "name":"Simple PWA Hello World", | |
| "short_name":"PWAHello", | |
| "start_url":"index.html", | |
| "display":"standalone", | |
| "background_color":"#5900b3", | |
| "theme_color":"black", | |
| "scope": ".", | |
| "description":"PWA Basics", | |
| "orientation": "portrait-primary", |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <!-- Meta Tags for Responsive Design --> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <title>Simple PWA Hello World</title> | |
This file contains hidden or 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
| // Include Electron | |
| const { app, BrowserWindow } = require('electron'); | |
| // Create the main window for the application | |
| function createMainWindow () { | |
| // Setup the windows options | |
| const win = new BrowserWindow({ | |
| width: 800, | |
| height: 800, | |
| webPreferences: { |
This file contains hidden or 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
| pragma solidity ^0.8.11; // Designate version of solidity | |
| import '@openzeppelin/contracts/token/ERC20/ERC20.sol'; // ERC20 template | |
| contract CodesphereToken is ERC20 { // Create contract using ERC20 interface | |
| constructor() ERC20('Codesphere Token', 'CDSP') { // Token Name and Ticker | |
| _mint(msg.sender, 10000); // Mint 10000 tokens at beginning | |
| } |