Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Making things!

Steve Schwarz saschwarz

💭
Making things!
View GitHub Profile
@saschwarz
saschwarz / .env
Created Feb 7, 2021
Building/Uploading Source Maps and Triggering a Deploy in Angular 11 to Rollbar
View .env
ROLLBAR_WRITE_ACCESS_TOKEN=
MAIN_APP_URL='https://...'
ROLLBAR_USERNAME=
View login-machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
View machine.js
const dogLifeMachine = Machine({
id: 'dogLife',
initial: 'bored',
context: {
},
states: {
bored: {
on: {
LETS_PLAY: 'door'
}
View machine.js
const dogPlay = Machine({
id: 'dogplay',
initial: 'sleeping',
context: {
doorOpen: false,
},
states: {
sleeping: {
on: {
View minimal-traffic-light-machine.js
const trafficLightMachine = Machine({
id: 'traffic-light',
initial: 'green',
context: {
retries: 0
},
states: {
green: {
on: {
View lets-play-machine-1.js
const dogTrainingMachine = Machine({
id: 'dogTraining',
initial: 'bored',
context: {
},
states: {
bored: {
on: {
LETS_PLAY: 'door'
@saschwarz
saschwarz / commands.js
Last active May 12, 2021
Automated Azure AD login and session token capture to json file for reading by Cypress commands. Heavily inspired by https://gist.github.com/pieterdv/82773fbe036719479d76ab0a4985dc3b
View commands.js
const API = Cypress.env('API');
const headers = {
Authorization: '',
};
Cypress.Commands.add('loginUser', () => {
return cy.readFile('aad-tokens.json')
.then(creds => {
// set auth headers so test setup calls are authorized
@saschwarz
saschwarz / app.module.ts
Last active Mar 12, 2018
Rollbar JS in Angular 4/Typescript
View app.module.ts
...
import { RollbarService, RollbarErrorHandler, rollbarFactory } from './rollbar';
@NgModule({
...
providers: [
{
provide: ErrorHandler,
useClass: RollbarErrorHandler
},
@saschwarz
saschwarz / revealjs-code-maximize-minimize.txt
Last active Dec 7, 2016
Maximize/Minimize Controls for highlight.js Code Sections in Reveal.js Slide Shows
View revealjs-code-maximize-minimize.txt
<!-- Paste the following into your Reveal.js index.html to add +/- buttons to every <code> section -->
<style>
.reveal .fullscreen {
width: 1000px;
height: 600px;
position: fixed;
top: 0;
left: 0;
z-index: 100;
max-height: none;
@saschwarz
saschwarz / pelican-livereload.py
Last active Nov 8, 2016
An enhanced version of pelican-livereload.py from https://merlijn.vandeen.nl/2015/pelican-livereload.html which watches content and theme directories and runs on either the specified SITEURL's host/port or the default liver eload host/port.
View pelican-livereload.py
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
from livereload import Server, shell
from pelican import Pelican
from pelican.settings import read_settings