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 random | |
p = 520 | |
g = 4 | |
class Person: | |
def __init__(self, name): | |
self.name = name | |
self.priv_key = random.randint(500, 4000) | |
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 './App.css'; | |
import {useEffect, useState} from 'react' | |
function App() { | |
const [orig, setOrig] = useState("") | |
const [redact, setRedact] = useState("") | |
const [guess, setGuess] = useState("") | |
const [guessCt, setGCt] = useState(0) | |
const [qa, setQA] = useState({q: "What is foo(3, 4)?", a: "5"}) | |
const [aGuess, setAG] = useState("") | |
const blurCode = (str) => { |
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 foo(x, y) { | |
let xSquared = x * x | |
let ySquared = y * y | |
return Math.sqrt( xSquared + ySquared ) | |
} |
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
async function loadSnippyly() { | |
await Snippyly.init("<Your API Key Goes Here>"); | |
const presenceElement = Snippyly.getPresenceElement(); | |
presenceElement.getOnlineUsersOnCurrentDocument().subscribe((data) => { | |
console.log('getOnlineUsersOnCurrentDocument in html', data); | |
}); | |
// To enable text comment feature |
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> | |
<style> | |
.box-container { | |
display: flex; | |
flex-wrap: wrap; | |
} | |
.box { |
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 required packages including the driver | |
import os | |
from urllib.parse import urlparse | |
from faunadb import query as faunaquery | |
from faunadb.client import FaunaClient | |
try: | |
secret = "DB_ACCESS_KEY" # Insert your access key here(USE ENVIRONMENT VARIABLES) | |
endpoint = "DB_ENDPOINT" # Insert your endpoint here(USE ENVIRONMENT VARIABLES) |
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'; | |
import { connect } from 'react-redux'; | |
import * as toDoAction from './actions/toDoAction'; | |
class App extends Component { | |
constructor(props){ | |
super(props); | |
this.handleChange = this.handleChange.bind(this); | |
this.handleSubmit = this.handleSubmit.bind(this); |
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'; | |
import './index.css'; | |
import App from './App'; | |
// Redux Import | |
import { Provider } from 'react-redux'; | |
import reportWebVitals from './reportWebVitals'; | |
// Store | |
import configureStore from './store/configureStore'; |
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 { createStore } from 'redux'; | |
import rootReducer from '../reducers'; | |
export default function configureStore(initialState) { | |
return createStore(rootReducer, initialState); | |
} |
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 { combineReducers } from 'redux'; | |
import todo from './toDoReducer'; | |
export default combineReducers({ | |
todo: todo | |
}); |