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
#!/bin/bash | |
# This script does some various utility tasks | |
# Builds the static site using Jekyll | |
# And syncs the generated site with S3 | |
# You can run this script with three options | |
# -i | enable Image processing. Creates thumbnails and quickly compresses images. | |
# -c | enable maximum Compression for images. Creates thumbnails, thoroughly compresses images, and takes a long time doing it | |
# -n | No-upload mode. Doesn't upload the build to S3. | |
# -s | enable Setup mode. Downloads the necessary npm files for compression |
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 checksum = (txt) => txt.split('').reduce((a, s, i) => a + (txt.charCodeAt(i) * (i + 1)), 0x12345678) |
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 regex = txt.match(/^\[[\S]+[\s][\S]+[\s]\wM\]\s[\w\s]+:\s/gm) |
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
#!/bin/sh | |
NAME=$(git branch | grep '*' | sed 's/* //') | |
DESCRIPTION=$(git config branch."$NAME".description) | |
echo "$NAME"': '$(cat "$1") > "$1" | |
if [ -n "$DESCRIPTION" ] | |
then | |
echo "" >> "$1" | |
echo $DESCRIPTION >> "$1" | |
fi |
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
@echo off | |
color 0a | |
echo " _____ ____ ____ _____ " | |
echo " |_ _| |_ \ / _||_ _| " | |
echo " | | | \/ | | | " | |
echo " | | _ | |\ /| | | | " | |
echo " _| |__/ | _| |_\/_| |_ _| |_ " | |
echo " |________||_____||_____||_____| " | |
echo " " |
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
Sub CreateMasterSheet(masterSheetName As String) | |
' This subroutine creates the Master sheet if we don't have one | |
Application.ScreenUpdating = False | |
Dim wrk As Workbook | |
Dim sheet As Worksheet | |
Dim masterSheet As Worksheet | |
Dim masterSheetExists As Boolean | |
masterSheetExists = False |
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 React, { useState, useEffect, useRef } from 'react' | |
import { StripeProvider } from 'react-stripe-elements' | |
type TProvider = React.FC<{ apiKey: string }> | |
const AsyncStripeProvider: TProvider = props => { | |
const { apiKey, children } = props | |
const [stripe, setStripe] = useState<stripe.Stripe | null>(null) | |
const isMounted = useRef(false) | |
const unmountFn = () => { |
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
type TWebmComponent = React.FC<{ videoUrl: string; fallbackUrl: string; description: string; onClick?: (e) =>void }> | |
const WebmComponent: TWebmComponent = ({ videoUrl, fallbackUrl, description, onClick = () => null }) => { | |
const supportsWebm = !!document.createElement('video').canPlayType | |
return ( | |
<> | |
<figure className="figure"> | |
<a |
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
#!/bin/sh | |
# Replace this with the path to your repository | |
REPOSITORY_DIR=/Users/davisford/Documents/sample-react-jupyterlab-extension | |
# Replace with the name of your conda environment | |
CONDA_ENV=jl-extension-env | |
# Helper function. | |
# Opens a new tab and executes a command in iTerm2 |
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 React from 'react' | |
import { ReactWidget } from '@jupyterlab/apputils' | |
import { Provider } from 'react-redux' | |
import store from '../ducks/store' | |
export class ReactAppWidget extends ReactWidget { | |
constructor() { | |
super() | |
} |
OlderNewer