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
| 'use client'; | |
| import { useRouter } from 'next/navigation'; | |
| import { useEffect } from 'react'; | |
| import { useFormState } from 'react-dom'; | |
| import * as actions from '@/actions'; | |
| export default function SnippetCreatePage() { | |
| const router = useRouter(); | |
| const [formState, action] = useFormState(actions.createSnippet, { |
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
| // ==UserScript== | |
| // @name Miro | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description Customize the Miro UI | |
| // @author StephenGrider | |
| // @match https://miro.com/app/board/* | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=miro.com | |
| // @grant none | |
| // ==/UserScript== |
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 { Reducer, Dispatch } from 'react'; | |
| import createDataContext from './createDataContext'; | |
| import { | |
| Actions, | |
| ChangeNameAction, | |
| StartRecordingAction, | |
| StopRecordingAction, | |
| AddLocationAction, | |
| ResetAction, | |
| } from './actions'; |
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 React from 'react'; | |
| const { useState, useEffect } = React; | |
| export default function App() { | |
| const [posts, setPosts] = useState([]); | |
| useEffect(() => { | |
| const getPosts = async () => { | |
| const fetchedPosts = await fetchPosts(); | |
| setPosts(fetchedPosts); |
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 React from 'react'; | |
| import ReactDOM from 'react-dom'; | |
| class TodoApp extends React.Component { | |
| // Initializes the 'state' property. This will create an instance variable | |
| // of 'this.state'. It is initialized one time, when the component is first instantiated | |
| state = { items: [], text: ''}; | |
| // constructor(props) { | |
| // super(props); |
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
| ----------------------------- MODULE Ticketing ----------------------------- | |
| EXTENDS TLC, Integers, Sequences | |
| (*--algorithm Ticketing | |
| \* Buyer and seller reflect the account balance of two different users | |
| variables | |
| seller = 0, | |
| buyer \in 1..2, | |
| ticket \in [status: {"onsale"}, price: 1..2] | |
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
| apiVersion: extensions/v1beta1 | |
| kind: Deployment | |
| metadata: | |
| name: deployment-pgadmin | |
| labels: | |
| name: deployment-pgadmin | |
| spec: | |
| replicas: 1 | |
| selector: | |
| matchLabels: |
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
| function flatten(node, oldPrefix = '') { | |
| let map = {}; | |
| let prefix = oldPrefix ? `${oldPrefix}.` : ''; | |
| for (let key in node) { | |
| const value = node[key]; | |
| if (value && !Array.isArray(value) && typeof value === 'object') { | |
| map = { ...map, ...flatten(value, `${prefix}${key}`)} | |
| } else { | |
| map = { ...map, ...{ [`${prefix}${key}`]: value } }; |
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 React, { Component } from "react"; | |
| class SearchBar extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { term: "" }; | |
| } | |
| render() { |
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
| const express = require('express'); | |
| const bodyParser = require('body-parser'); | |
| const url = require('url'); | |
| const HDWalletProvider = require('truffle-hdwallet-provider'); | |
| const Web3 = require('web3'); | |
| const infura_apikey = 'YOUR_INFURA_KEY'; | |
| const mnemonic = | |
| 'YOUR_MNEMONIC'; |
NewerOlder