Skip to content

Instantly share code, notes, and snippets.

View thbland's full-sized avatar

Troy Bland thbland

View GitHub Profile
@thbland
thbland / index.pug
Created October 28, 2019 15:02
vue-agile – default settings and minimal styles
#app
agile
div.slide(v-for="n in 6", :key="n", :class="`slide--${n}`")
h3 {{ n }}
template(slot="prevButton")
i.fas.fa-chevron-left
template(slot="nextButton")
i.fas.fa-chevron-right
@thbland
thbland / index.html
Created November 12, 2019 01:14
Tic Tac Toe
<div id="errors" style="
background: #c00;
color: #fff;
display: none;
margin: -20px -20px 20px;
padding: 20px;
white-space: pre-wrap;
"></div>
<div id="root"></div>
<script>
@thbland
thbland / index.html
Created June 9, 2020 20:31
Vue/Bootstrap Template
<div id="app">
<nav class="navbar navbar-light fixed-top">
<div class="navbar-text ml-auto d-flex">
<button class="btn btn-sm btn-outline-success"
@click="sliderStatus = !sliderStatus">
<i class="fas fa-dollar-sign"></i></button>
<div class="dropdown ml-2" v-if="cart.length>0">
<button class="btn btn-success btn-sm dropdown-toggle"
id="cartDropdown" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
@thbland
thbland / css-grid-newspaper-layout.markdown
Created April 4, 2021 16:23
CSS Grid: Newspaper Layout
@thbland
thbland / css-grid-newspaper-layout.markdown
Created April 4, 2021 16:23
CSS Grid: Newspaper Layout
@thbland
thbland / decoratedFetch.ts
Created April 24, 2021 19:27 — forked from panzerdp/decoratedFetch.ts
An extensible fetch() implementation that uses the decorator pattern
type ResponseWithData = Response & { data?: any };
interface Fetcher {
run(input: RequestInfo, init?: RequestInit): Promise<ResponseWithData>;
}
class BasicFetcher implements Fetcher {
async run(input: RequestInfo, init?: RequestInit): Promise<ResponseWithData> {
return await fetch(input, init);
}
@thbland
thbland / machine.js
Created April 26, 2021 05:52
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@thbland
thbland / web-servers.md
Created May 3, 2021 18:09 — forked from cferdinandi/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000