Skip to content

Instantly share code, notes, and snippets.

import random
p = 520
g = 4
class Person:
def __init__(self, name):
self.name = name
self.priv_key = random.randint(500, 4000)
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) => {
function foo(x, y) {
let xSquared = x * x
let ySquared = y * y
return Math.sqrt( xSquared + ySquared )
}
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
<!DOCTYPE html>
<html lang="en">
<head>
<style>
.box-container {
display: flex;
flex-wrap: wrap;
}
.box {
# 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)
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);
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';
import { createStore } from 'redux';
import rootReducer from '../reducers';
export default function configureStore(initialState) {
return createStore(rootReducer, initialState);
}
import { combineReducers } from 'redux';
import todo from './toDoReducer';
export default combineReducers({
todo: todo
});