Skip to content

Instantly share code, notes, and snippets.

View gbishop's full-sized avatar

Gary Bishop gbishop

View GitHub Profile
@gbishop
gbishop / gist:f1bdcdc8cafe673353c506fd8185410a
Created July 27, 2017 14:48
typescript discriminated union question
interface HomeView {
view: 'home';
}
export interface BookView {
view: 'book';
link: string;
page: number;
}
@gbishop
gbishop / output.txt
Created July 16, 2017 19:35
typescript errors on CSSProperties
rewrite (master *%)$ tsc
src/NavFrame.tsx(53,65): error TS2345: Argument of type '{ width: string; fontSize: string; } | { width: string; height: string; fontSize: string; alignSe...' is not assignable to parameter of type 'CSSProperties'.
Type '{ width: string; height: string; fontSize: string; alignSelf: string; }' is not assignable to type 'CSSProperties'.
Types of property 'alignSelf' are incompatible.
Type 'string' is not assignable to type '"auto" | "center" | "initial" | "inherit" | "unset" | "flex-start" | "flex-end" | "stretch" | "ba...'.
src/NavFrame.tsx(57,65): error TS2345: Argument of type '{ width: string; fontSize: string; } | { width: string; height: string; fontSize: string; alignSe...' is not assignable to parameter of type 'CSSProperties'.
Type '{ width: string; height: string; fontSize: string; alignSelf: string; }' is not assignable to type 'CSSProperties'.
@gbishop
gbishop / index.html
Created July 3, 2017 11:37
JS Bin css transition zoom book // source https://jsbin.com/bucuju
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="css transition zoom book">
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
ul {
@gbishop
gbishop / runner.py
Created September 30, 2016 22:26
A script to time running Jupyter notebooks
import nbformat
from nbconvert.preprocessors import ExecutePreprocessor
import sys
import time
notebook_filename = sys.argv[1]
t0 = time.time()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gbishop
gbishop / Args.ipynb
Last active September 19, 2024 14:59
Allow arguments to be passed to notebooks via URL or command line.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gbishop
gbishop / NotebookArgs.ipynb
Created February 5, 2016 18:17
Get sys.argv from the query string. This way I can link notebooks together passing args along.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gbishop
gbishop / comp116.py
Created January 15, 2014 20:40
Simple python module to download iPython Notebooks and supporting files for my students in Comp116
'''Comp116 support module with tools for downloading assignments, lecture notes, and exams'''
import urllib
import os
import os.path as osp
import urlparse
import json
import time
ATTEMPTS = 10
@gbishop
gbishop / fonts.conf
Created November 21, 2012 14:00
Replace sans-serif and Arial fonts with Ubuntu
<!--?xml version="1.0"?>-->
<!--DOCTYPE fontconfig SYSTEM "fonts.dtd">-->
<!-- ~/.fonts.conf for per-user font configuration -->
<fontconfig>
<alias>
<family>sans-serif</family>
<prefer>
<family>Ubuntu</family>
</prefer>
</alias>