Testing code syntax first.
const test: number = 4;
Done!
Testing code syntax first.
const test: number = 4;
Done!
export function downloadCsv(csv: any, filename: string) { | |
const blob = new Blob([csv], { type: 'text/csv' }); | |
/* taken from react-csv */ | |
if (navigator && navigator.msSaveOrOpenBlob) { | |
navigator.msSaveOrOpenBlob(blob, filename); | |
} else { | |
const dataURI = `data:text/csv;charset=utf-8,${csv}`; | |
const URL = window.URL || window.webkitURL; |
const CSV_PREFIX = 'data:text/csv;charset=utf-8,'; | |
export const exportToCsv = ( | |
data: { [key: string]: any }[], | |
prefix = CSV_PREFIX | |
) => { | |
if (data.length === 0) { | |
return ''; | |
} |
const chai = require('chai'); | |
const chaiHttp = require('chai-http'); | |
const server = require('../server'); | |
const should = chai.should(); | |
const Pet = require('../models/pet'); | |
// BETTER TEST COMING SOON! | |
const fido = { |
<!DOCTYPE html> | |
<html> | |
<head> | |
<!-- <script src='https://cdn.tiny.cloud/1/no-api-key/tinymce/5/tinymce.min.js' referrerpolicy="origin"></script> --> | |
<script> | |
tinymce.init({ | |
selector: '#mytextarea' | |
}); | |
</script> | |
</head> |
// ---------------------------------------------------------------------------------- | |
// Imports | |
// ---------------------------------------------------------------------------------- | |
import { | |
View, | |
Text, | |
Image, | |
ScrollView, | |
TextInput, |
import string | |
import sys | |
def puzzle(ds, b): | |
v = {c: i for i, c in enumerate(string.printable[:36])} | |
return sum(v[d] * b**e for e, d in enumerate(ds[::-1])) | |
if __name__ == '__main__': |
const User = require('../models/user'); | |
const jwt = require('jsonwebtoken'); | |
function checkAuth (req, res, next) { | |
if (req.cookies && req.cookies.nToken) { | |
const uid = jwt.decode(req.cookies.nToken, process.env.SECRET)._id; | |
User.findById(uid).then(user => { | |
req.user = user; | |
return next(); | |
}); |
def _find_node_recursive(self, item, node): | |
"""Return the node containing the given item in this binary search tree, | |
or None if the given item is not found. Search is performed recursively | |
starting from the given node (give the root node to start recursion). | |
TODO: Best case running time: ??? under what conditions? | |
TODO: Worst case running time: ??? under what conditions?""" | |
# Check if starting node exists | |
if node is None: | |
# Not found (base case) | |
return None |
# Instructions / Question: | |
# Given a standard English sentence passed in as a string, | |
# write a method that will return a sentence comprised of the same words, | |
# but sorted by their first letter. | |
# However, the method of sorting has a twist to it: | |
# all words that begin with a lowercase letter should be | |
# at the beginning of the sorted sentence, | |
# and sorted in ascending order. All words that begin with | |
# an uppercase letter should come after that, and should be sorted |