Open ~/.bash_profile in your favorite editor and add the following content to the bottom.
# Git branch in prompt.
parse_git_branch() {| // Types for the result object with discriminated union | |
| type Success<T> = { | |
| data: T; | |
| error: null; | |
| }; | |
| type Failure<E> = { | |
| data: null; | |
| error: E; | |
| }; |
| # ----------------------------------------------------------------- | |
| # .gitignore | |
| # Bare Minimum Git | |
| # https://salferrarello.com/starter-gitignore-file/ | |
| # ver 20210211 | |
| # | |
| # From the root of your project run | |
| # curl -O https://gist.github.com/salcode/10017553/raw/.gitignore | |
| # to download this file | |
| # |
| // Top level App component | |
| import React from "react"; | |
| import { ProvideAuth } from "./use-auth.js"; | |
| function App(props) { | |
| return ( | |
| <ProvideAuth> | |
| {/* | |
| Route components here, depending on how your app is structured. | |
| If using Next.js this would be /pages/_app.js |
| # https://gist.github.com/codexico/2a34c0d599f3af93b46f | |
| [color] | |
| # Use colors in Git commands that are capable of colored output when | |
| # outputting to the terminal. (This is the default setting in Git ≥ 1.8.4.) | |
| ui = auto | |
| [color "branch"] |
⇐ back to the gist-blog at jrw.fi
Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.
I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.
This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso
| // Async await func | |
| async function getTimelineData() { | |
| var response = await fetch('/some-api-url') | |
| return response.json() | |
| } | |
| async function populateTimelineInit() { | |
| var data = await getTimelineData(); | |
| new vis.DataSet(data); |
| # Insomnia Configuration | |
| ## Run the test query | |
| { | |
| shop { | |
| id | |
| name | |
| } | |
| } | |
| # Query Structure Examples |
| <div data-section-type="cart-template"> | |
| <div class="page-header"> | |
| <h1 class="majortitle">{{ 'cart.general.title' | t }}</h1> | |
| </div> | |
| {% if cart.items == empty %} | |
| <div class="row-spacing align-centre"> | |
| <p>{{ 'cart.general.empty' | t }}</p> | |
| </div> | |
| {% else %} |