Skip to content

Instantly share code, notes, and snippets.

View antondevv's full-sized avatar

Anton Franzen antondevv

View GitHub Profile
@antondevv
antondevv / myfirstsmartcontract-step2.js
Created November 11, 2022 21:46
Install dependencies
npm i --save-dev @nomiclabs/hardhat-ethers hardhat ethers
mkdir my-first-smart-contract
cd my-first-smart contract
npm init -y
@antondevv
antondevv / test.json
Created November 7, 2022 11:40
test.json
ref: {"_reactInternalInstance": {}, "_reactInternals": {"_debugHookTypes": null, "_debugNeedsRemount": false, "_debugOwner": {"_debugHookTypes": [Array], "_debugNeedsRemount": false, "_debugOwner": [FiberNode], "_debugSource": undefined, "actualDuration": 2.193289041519165, "actualStartTime": 1018307192.845583, "alternate": [FiberNode], "child": [Circular], "childLanes": 0, "deletions": null, "dependencies": null, "elementType": [Object], "flags": 8388608, "index": 0, "key": null, "lanes": 0, "memoizedProps": [Object], "memoizedState": [Object], "mode": 2, "pendingProps": [Object], "ref": [Object], "return": [FiberNode], "selfBaseDuration": 0.07875001430511475, "sibling": [FiberNode], "stateNode": null, "subtreeFlags": 8389125, "tag": 11, "treeBaseDuration": 2.1475385427474976, "type": [Object], "updateQueue": [Object]}, "_debugSource": null, "actualDuration": 2.1919140815734863, "actualStartTime": 1018307192.8525, "alternate": {"_debugHookTypes": null, "_debugNeedsRemount": false, "_debugOwner": [FiberNode],
import React from 'react';
var styles = "h1 {\n font-size: 20px;\n color: purple;\n}\n";
const RangeSlider = ({}) => {
return (React.createElement(React.Fragment, null,
React.createElement("style", null, styles),
React.createElement("h1", null, "Range Slider!!!!"),
React.createElement("input", {
type: "range", min: "2000", max: "30000", step: "500" })));
function fromDir(pathName) {
const files = fs.readdirSync(pathName);
files.forEach((file) => {
const filename = path.join(pathName, file);
const stat = fs.lstatSync(filename);
if (stat.isDirectory()) {
fromDir(filename);
} else {
compileFile(
filename,
@antondevv
antondevv / recursive.js
Created April 10, 2022 13:51
recursive
let files = [];
function fromDir(pathName) {
const entries = getEntries(pathName);
entries.forEach((entry) => {
const entryPath = `${pathName}/${entry}`;
const typeOfEntry = getTypeOfEntry(entryPath);
if (typeOfEntry.isDirectory()) {
fromDir(entryPath);
} else {
files.push(entryPath);
@antondevv
antondevv / app.js
Created April 2, 2022 12:47
final-code
import { useSelector, useDispatch } from "react-redux";
import { changeUsersName } from "./redux/actions/changeUsersName";
import { changeUsersAge } from "./redux/actions/changeUsersAge";
import { useState } from "react";
function App() {
const user = useSelector((state) => state.userReducer);
const dispatch = useDispatch();
const [name, setName] = useState(user.name);
@antondevv
antondevv / app.js
Created April 2, 2022 12:43
display user
import { useSelector } from "react-redux";
function App() {
const user = useSelector((state) => state.userReducer);
return (
<div className="App">
<h1>Name: {user.name}</h1>
<h1>Age: {user.age}</h1>
</div>
@antondevv
antondevv / storeprovider.js
Created April 2, 2022 11:59
Store provider
import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
import store from "./redux/store";
import { Provider } from "react-redux";
ReactDOM.render(
<Provider store={store}>
<App />
@antondevv
antondevv / store.js
Last active April 2, 2022 12:40
store
import { createStore } from "redux";
import userReducer from "./reducers/userReducer";
const store = createStore(userReducer);
export default store;