Skip to content

Instantly share code, notes, and snippets.

View saschwarz's full-sized avatar
💭
Making things!

Steve Schwarz saschwarz

💭
Making things!
View GitHub Profile
@saschwarz
saschwarz / pelican-livereload.py
Last active November 8, 2016 17:32
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.
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
@saschwarz
saschwarz / revealjs-code-maximize-minimize.txt
Last active December 7, 2016 16:25
Maximize/Minimize Controls for highlight.js Code Sections in Reveal.js Slide Shows
<!-- 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 / app.module.ts
Last active March 12, 2018 11:33
Rollbar JS in Angular 4/Typescript
...
import { RollbarService, RollbarErrorHandler, rollbarFactory } from './rollbar';
@NgModule({
...
providers: [
{
provide: ErrorHandler,
useClass: RollbarErrorHandler
},
const trafficLightMachine = Machine({
id: 'traffic-light',
initial: 'green',
context: {
retries: 0
},
states: {
green: {
on: {
@saschwarz
saschwarz / machine.js
Last active March 9, 2020 13:40
Generated by XState Viz: https://xstate.js.org/viz
const dogPlay = Machine({
id: 'dogplay',
initial: 'sleeping',
context: {
doorOpen: false,
},
states: {
sleeping: {
on: {
const dogTrainingMachine = Machine({
id: 'dogTraining',
initial: 'bored',
context: {
},
states: {
bored: {
on: {
LETS_PLAY: 'door'
@saschwarz
saschwarz / machine.js
Created March 13, 2020 19:17
Generated by XState Viz: https://xstate.js.org/viz
const dogLifeMachine = Machine({
id: 'dogLife',
initial: 'bored',
context: {
},
states: {
bored: {
on: {
LETS_PLAY: 'door'
}
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@saschwarz
saschwarz / .env
Created February 7, 2021 20:11
Building/Uploading Source Maps and Triggering a Deploy in Angular 11 to Rollbar
ROLLBAR_WRITE_ACCESS_TOKEN=
MAIN_APP_URL='https://...'
ROLLBAR_USERNAME=
@saschwarz
saschwarz / commands.js
Last active August 31, 2022 07:16
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
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