pip install colorama
#
from colorama import Fore, Back, Style
# Colors
Fore.RED
Back.GREEN
Style.RESET_ALL
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
| def is_prime(x): | |
| return not any(x//i == x/i for in range(x-1, 1, -1)) |
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
| SELECT username, email, COUNT(*) | |
| FROM users | |
| GROUP BY username, email | |
| HAVING COUNT(*) > 1 |
const regexDesc = />(.*?)<\/a>/;const descriptionContent = $(value)
.find('description')
.text();const description = regexDesc.exec(descriptionContent)[1];handleValue1031InputChange = event => {
let value1031 = event.target.value
if (value1031.length === 0) {
this.setState({ value1031: '', isValidValue1031: false })
} else if (value1031.length > 0 && this.validateValue1031(value1031)) {
value1031 = this.commify(value1031)
this.setState({ value1031, isValidValue1031: true })
}
}const forms = [
{id: 1, text: 'sell', time_created: 1568922447},
{id: 2, text: 'buy', time_created: 1568929208}
]
const messages = [
{id: 1, text: 'yo bozo boy', time_created: 1568842057},
{id: 2, text: 'ill take it', time_created: 1568999255}
]let tempnames = []
const users = [1217, 9000]
const contacts = [
{user_id: 1217, name: 'JJ'},
{user_id: 3000, name: 'Muffin'},
{user_id: 4500, name: 'Jessie'},
{user_id: 9000, name: 'Iggy'},
]
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
| focusedOnInput = () => { | |
| if (document.getElementById('MessageInput')) { | |
| setTimeout(() => document.getElementById('MessageInput').focus(), 0) | |
| } | |
| } |
-
Bring necessary modules
const socketIO = require('socket.io')
const app = require('./backend/app') -
Wrap socketio with server
const io = socketIO(httpServer) -
Assign variables and io to app
app.userIdToSocket = {}
app.io = io.on('connection'...