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
from abc import ABCMeta, abstractmethod | |
class IComponent(metaclass=ABCMeta): | |
@staticmethod | |
@abstractmethod | |
def notify(msg): | |
"""The required notify method""" | |
@staticmethod |
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
from abc import ABCMeta, abstractmethod | |
class IIterator(metaclass=ABCMeta): | |
@staticmethod | |
@abstractmethod | |
def has_next(): | |
"""Returns Boolean whether at end of collection or not""" | |
@staticmethod | |
@abstractmethod |
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
""" | |
Observer Design Pattern | |
""" | |
from abc import ABCMeta, abstractmethod | |
class IObservable(metaclass=ABCMeta): | |
@staticmethod | |
@abstractmethod |
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
import * as THREE from '/build/three.module.js'; | |
import {OrbitControls} from '/jsm/controls/OrbitControls.js'; | |
import Stats from '/jsm/libs/stats.module.js'; | |
const scene = new THREE.Scene(); | |
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 100); | |
camera.position.z = 2; | |
const renderer = new THREE.WebGLRenderer(); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Three.js Tutorials by Sean Bradley : https://sbcode.net/threejs/</title> | |
<style> | |
body { | |
overflow: hidden; | |
margin: 0px; | |
} | |
</style> |
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
const express = require('express') | |
const app = express() | |
const path = require('path') | |
app.use(express.static(__dirname + '/public')) | |
app.use('/build/', express.static(path.join(__dirname, 'node_modules/three/build'))); | |
app.use('/jsm/', express.static(path.join(__dirname, 'node_modules/three/examples/jsm'))); | |
app.listen(3000, () => | |
console.log('Visit http://127.0.0.1:3000') |
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
#Copyright 2020 Sean Bradley https://sbcode.net/grafana/ MIT License | |
from flask import Flask, request | |
import boto3 | |
APP = Flask(__name__) | |
CLIENT = boto3.client( | |
"sns", | |
aws_access_key_id="your_access_key_id", | |
aws_secret_access_key="you_secret_access_key", |
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
INSERT INTO `exampledb`.`flat_table_example` | |
(`username`, | |
`total`) | |
VALUES | |
('Cat',56), | |
('Dog',5), | |
('Lizard',4), | |
('Crocodile',2), | |
('Koala',50), | |
('Cassowary',2), |
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
CREATE TABLE `exampledb`.`flat_table_example` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`username` varchar(45) DEFAULT NULL, | |
`total` decimal(10,0) DEFAULT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1; |
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
[Unit] | |
Description=Promtail service | |
After=network.target | |
[Service] | |
Type=simple | |
User=promtail | |
ExecStart=/usr/local/bin/promtail -config.file /usr/local/bin/config-promtail.yml | |
[Install] |