This file contains 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
/** | |
* This script is intended to convert all relative imports in this project into | |
* absolute imports from the reference of the 'src' directory. | |
* | |
* Additional rules: | |
* - Files in src/core should not be effected | |
*/ | |
const fs = require('fs'); | |
const path = require('path'); |
This file contains 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
/** | |
* This script is intended to convert all relative imports in this project into | |
* absolute imports from the reference of the 'src' directory. | |
* | |
* Additional rules: | |
* - Files in src/core should not be effected | |
*/ | |
import fs from 'fs'; | |
import path from 'path'; |
This file contains 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 your custom theme: | |
Select "Custom" theme in the dashboard | |
On your https://poll.ma.pe/overlay/<id>/ URL add ?customCss=https://example.com/style.css | |
Please keep the link to https://poll.ma.pe visible for a short period of time. | |
*/ | |
@import url(https://fonts.googleapis.com/css?family=Abel); |
This file contains 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
Concurrent programming is programming that is concurrent. |
This file contains 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
from os import listdir, system | |
from os.path import isdir, join | |
# Source: react-js-to-ts - https://www.npmjs.com/package/react-js-to-ts | |
# Source: js-to-ts-converter - https://www.npmjs.com/package/js-to-ts-converter | |
def get_filepaths(folder_path): | |
filepaths = [] | |
for filepath in listdir(folder_path): | |
complete_path = join(folder_path, filepath) |
This file contains 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 convert_to_roman(num: int) -> str: | |
'''Takes an integer and returns its value in roman numerals''' | |
conversion_table = [ | |
(1000, 'M'), (900, 'CM'), | |
(500, 'D'), (400, 'CD'), | |
(100, 'C'), (90, 'XC'), | |
(50, 'L'), (40, 'XL'), | |
(10, 'X'), (9, 'IX'), | |
(5, 'V'), (4, 'IV'), |
This file contains 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 frequent_words(text, k): | |
frequencies = {} | |
most_frequent = [] | |
words = text.split(" ") | |
for word in words: | |
if word not in frequencies: | |
frequencies[word] = 0 | |
frequencies[word] += 1 |
This file contains 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
// OLD CODE | |
const SignUp = async (req, res) => { | |
// Check if the user already exists | |
const user = await User.findOne({ email: req.body.email }, 'email password name'); | |
if (user) { | |
user.comparePassword(req.body.password, (error, matched) => { | |
if (error) { | |
if (req.is('application/json')) { | |
return res.json({ error: 'Account with that email address already exists.' }); | |
} |