Skip to content

Instantly share code, notes, and snippets.

View stephenway's full-sized avatar

Stephen Way stephenway

View GitHub Profile
@stephenway
stephenway / ButtonExamples.jsx
Created July 31, 2017 22:31
MDStyled Button Examples
<div>
<Button handleRoute = {() => {}}>Default</Button>
<Button raised handleRoute={() => {}}>Raised</Button>
<Button dense handleRoute={() => {}}>Dense Default</Button>
<Button raised dense handleRoute={() => {}}>Dense Raised</Button>
<Button compact handleRoute={() => {}}>Compact</Button>
<Button compact raised handleRoute={() => {}}>Compact Raised</Button>
<Button primary handleRoute={() => {}}>Default with Primary</Button>
<Button raised primary handleRoute={() => {}}>Raised with Primary</Button>
<Button accent handleRoute={() => {}}>Default with Accent</Button>
@stephenway
stephenway / fullscreen.cljs
Created January 31, 2017 16:31
Clojurescript Fullscreen Button
(defn get-canvas []
"Returns canvas that will be fullscreened after a click."
(let [canvas (.getElementById js/document "article")
btnStatusBoard (.getElementById js/document "btnStatusBoard")]
(when canvas (.addEventListener btnStatusBoard "click" #(.webkitRequestFullscreen canvas)))
canvas))
(dom/button #js {:className "c-button c-button--text"
:id "btnStatusBoard"
:title (tr "Fullscreen")}
@stephenway
stephenway / style_helpers.cljs
Created October 25, 2016 18:11
Garden helpers for CSS in cljs
(ns project.ui.style-helpers
(:require [om.next :as om :refer-macros [defui]]
[om.dom :as dom]
[om-css.core :as csc]
[garden.core :as g]
[garden.stylesheet :as gs]
[garden.selectors :as s]))
(def ^:once browsers
@stephenway
stephenway / color.cljs
Created October 25, 2016 18:10
Color palette for cljs
(ns project.ui.color)
(def orange
{:50 "#ffcc80"
:100 "#ffc16d"
:200 "#ffb75c"
:300 "#ffad4a"
:400 "#fea139"
:500 "#ff9800"
:600 "#f98d1d"
@stephenway
stephenway / .spacemacs
Created September 7, 2016 17:44
My spacemacs config
;; -*- 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
;; Base distribution to use. This is a layer contained in the directory
@stephenway
stephenway / onClick-class.cljs
Created December 29, 2015 18:01
On click, add this class to my object
(ns projectName.core
(:require
goog.object
[om.next :as om :refer-macros [defui]]
[om.dom :as dom]
[untangled.dom :as udom]
))
(defui Root
Object
@stephenway
stephenway / git-change-author-commit.sh
Created December 19, 2015 04:02
Change last commit author
git commit --amend --author "Stephen Way <way.stephen@gmail.com>" --no-edit && \
git rebase --continue
...
git push origin master --force
@stephenway
stephenway / padding-scale.pcss
Created December 4, 2015 19:21
PostCSS Padding Scale
.padding-class {
&__full { padding: 1em; }
&__half { padding: calc(1em / 2); }
&__quarter { padding: calc(1em / 4); }
&__double { padding: calc(1em * 2); }
&__treble { padding: calc(1em * 3); }
&__quadruple { padding: calc(1em * 4); }
}
@stephenway
stephenway / git-rewrite.sh
Created December 3, 2015 15:00
Rewrite git author name and email
git filter-branch --commit-filter 'if [ "$GIT_AUTHOR_NAME" = "Josh Lee" ];
then export GIT_AUTHOR_NAME="Hobo Bob"; export GIT_AUTHOR_EMAIL=hobo@example.com;
fi; git commit-tree "$@"'
/*---
section: Base
title: Shapes
---
```html_example
<span class="o-triangle--right"></span>
```
*/