Skip to content

Instantly share code, notes, and snippets.

@bshelling
bshelling / kiosk.yml
Created June 20, 2023 10:17
Cloudformation Template for a email subscription backend
Transform: AWS::Serverless-2016-10-31
Globals:
Function:
Runtime: nodejs18.x
Description: "Full stack email subscription application for kiosks architected by B.Shelling"
Parameters:
ROOTDOMAIN:
Type: "String"
@bshelling
bshelling / block.js
Last active March 31, 2020 03:53
Create a Custom Gutenberg Block in Wordpress
//Create a Custom Gutenberg Block in Wordpress
// Author: bshelling
// Link:
import { registerBlockType } from '@wordpress/blocks';
const homeBlock = <div className="homepage-section-block"><h1 className="title">Headline</h1><p className="description">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce in dui sapien. Donec tincidunt diam in libero porttitor, quis feugiat diam mollis.
</p><button>Read More</button></div>;
registerBlockType('bshelling/hm-section-block',{
@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])
@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 / 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.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 / 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 / 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 / settings.json
Created January 22, 2020 15:26
Markdown - Settings
{
"markdown.styles": [
"css/mystylesheet.css",
"https://cdn.example.com/fontStyle.css"
]
}