Skip to content

Instantly share code, notes, and snippets.

View cbillowes's full-sized avatar
:octocat:

Clarice Bouwer cbillowes

:octocat:
View GitHub Profile

Boilerplate Create React App

Create a boilerplate Redux React app with some additional bells and whistles including Tailwind CSS and Firebase.

# https://redux.js.org/introduction/getting-started
npx create-react-app some-special-unicorn-idea --template redux

# Don't forget to gitify it and commit everything once off
cd some-special-unicorn-idea && git init && git add . && git commit -m "initial commit 🦄"
@cbillowes
cbillowes / build-theme.sh
Created February 17, 2022 22:19
Read from files
#!/bin/bash
# places to read files from
paths=("../src/themes/**/index.js" "../src/themes/base.js")
rm -rf ./tmp/themes
mkdir -p ./tmp/themes
# this was an experiement to add dynamic files for tests
# in Storybook.
{"lastUpload":"2021-11-16T07:47:03.969Z","extensionVersion":"v3.4.3"}
{"lastUpload":"2021-05-17T18:37:16.833Z","extensionVersion":"v3.4.3"}
@cbillowes
cbillowes / advanced-git.txt
Last active October 5, 2019 17:02
Advanced Git commands
# list all commits for a given file which includes cases where the file has been renamed.
git log --follow -- filename
# log with a decorated graph
git log --graph --abbrev-commit --decorate --date=relative --all
# short status on branch
git status --short --branch
# see log with diffs
@cbillowes
cbillowes / .spacemacs
Created August 21, 2019 08:57
Spacemacs
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
#!/bin/bash
echo "Countdown"
date1=$((`date +%s` + $1));
while [ "$date1" -ge `date +%s` ]; do
echo -ne "$(date -u --date @$(($date1 - `date +%s`)) +%H:%M:%S)\r";
sleep 0.1
done
@cbillowes
cbillowes / unhide.sh
Last active October 11, 2018 16:26
Unhide linux files
#!/bin/bash
#print usage
if [ -z $1 ];then
echo "Usage :$(basename $0) parent-directory"
exit 1
fi
for name in $1/.*; do
if [ $(dirname "${name}") != "." ]; then
new_name="$(dirname ${name})/$(basename "${name}" | cut -c 2-)"
@cbillowes
cbillowes / stopwatch.sh
Last active October 17, 2018 17:02
Stopwatch
#!/bin/bash
echo "Stopwatch"
date1=`date +%s`;
while true; do
echo -ne "$(date -u --date @$((`date +%s` - $date1)) +%H:%M:%S)\r";
sleep 0.1
done
@cbillowes
cbillowes / throwing-dice.js
Last active September 3, 2018 02:46
Throwing dice
(function () {
const dice = 3;
const variations = 6;
const point = 10;
function roll() {
let number = Math.round(Math.random() * variations);
return number ? number : 1;
}