Skip to content

Instantly share code, notes, and snippets.

import * as actionTypes from '../actions/actionTypes';
export default (state = [], action) => {
switch (action.type){
case actionTypes.CREATE_NEW_TODO:
return [
...state,
Object.assign({}, action.todo)
];
import * as actionTypes from './actionTypes';
export const createToDo = (todo) => {
return {
type: actionTypes.CREATE_NEW_TODO,
todo: todo
}
};
export const deleteToDo = (id) => {
<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>
<!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());
// Window Load Event
window.addEventListener('load', () => {
registerWorker();
});
// Register Worker Function
async function registerWorker() {
if ('serviceWorker' in navigator) {
try {
await navigator
var staticCacheName = "hello-pwa";
self.addEventListener("install", function (e) {
e.waitUntil(
caches.open(staticCacheName).then(function (cache) {
return cache.addAll(["/"]);
})
);
});
{
"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",
<!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>
@LiorB-D
LiorB-D / index.js
Last active January 24, 2022 16:29
// 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: {
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
}