Skip to content

Instantly share code, notes, and snippets.

@bshelling
bshelling / cloudSettings
Last active October 9, 2019 01:48
Segment and utm extract
{"lastUpload":"2019-10-09T01:48:22.628Z","extensionVersion":"v3.4.3"}
@bshelling
bshelling / database.test.js
Last active January 19, 2020 17:29
Database Testing Example
const mongoose = require('mongoose');
require('dotenv').config();
describe('Customer CRUD',() => {
let connection;
let database;
const customers = mongoose.model("test_"+process.env.COLLECTION,mongoose.Schema({
name: String,
email: String
}));
@bshelling
bshelling / settings.json
Created January 22, 2020 15:26
Markdown - Settings
{
"markdown.styles": [
"css/mystylesheet.css",
"https://cdn.example.com/fontStyle.css"
]
}
@bshelling
bshelling / package.json
Last active January 22, 2020 15:36
Markdown - Package
{
"name": "markdown_article",
"version": "1.0 .0 ",
"main": "index.js",
"license": "MIT",
"scripts": {
"serve": "./node_modules/.bin/webpack-dev-serve"
},
"dependencies": {
"html-loader": "0.5.5",
@bshelling
bshelling / webpack.config.js
Created January 22, 2020 15:38
Markdown - Webpack configuration
const path = require('path');
const HtmlWebPlugin = require('html-webpack-plugin');
const marked = require('marked');
const renderer = new marked.Renderer();
module.exports = {
entry: './src/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname,'dist')
},
@bshelling
bshelling / webpack.config.js
Created January 22, 2020 15:38
Markdown - Webpack configuration
const path = require('path');
const HtmlWebPlugin = require('html-webpack-plugin');
const marked = require('marked');
const renderer = new marked.Renderer();
module.exports = {
entry: './src/index.js',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname,'dist')
},
@bshelling
bshelling / index.html
Created January 22, 2020 15:40
Markdown - Index
<!DOCTYPE html>
<html>
<head>
<meta charset=”UTF-8">
<title>Markdown Example</title>
<link rel=”stylesheet” href=”src/style.css”>
</head>
<body>
<div id=”container”></div>
<script type=”text/javascript” src=”bundle.js”></script></body>
@bshelling
bshelling / index.html
Created January 22, 2020 15:41
Markdown - Index
<!DOCTYPE html>
<html>
<head>
<meta charset=”UTF-8">
<title>Markdown Example</title>
<link rel=”stylesheet” href=”src/style.css”>
</head>
<body>
<div id=”container”></div>
<script type=”text/javascript” src=”bundle.js”></script></body>
@bshelling
bshelling / index.js
Created January 22, 2020 15:48
Markdown - Index.js
/**
* Import markdown file
*/
const chaperOne = require(‘../Chapter_01/chapter01.md’);
/**
* CDN Bootstrap stylesheet
*/
const markdownCss = ‘https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css';
/**
* Create link tag
@bshelling
bshelling / app.py
Last active February 17, 2020 17:59
Get the players
import os
import csv
import requests
import time
imageDir = os.listdir('./players')
with open('fifaplayers.csv',newline='') as playersFile:
players = csv.reader(playersFile,delimiter=",")
for player in players:
r = requests.get(player[1])