Skip to content

Instantly share code, notes, and snippets.

View dwayne's full-sized avatar

Dwayne Crooks dwayne

View GitHub Profile
@dwayne
dwayne / custom-properties.md
Last active August 7, 2023 08:34
Elm Odds and Ends

Custom Properties in Elm

Html.Attributes.style does not support setting custom properties. For e.g. the following won't work:

style "--alert-text-color" "#123456"

re: [Asking for support][support]

@dwayne
dwayne / quotes.json
Last active January 8, 2024 10:19
Quotes for the random quote machine web app
{
"quotes": [
{ "text": "Life isn't about getting and having, it's about giving and being.", "author": "Kevin Kruse" },
{ "text": "Whatever the mind of man can conceive and believe, it can achieve.", "author": "Napoleon Hill" },
{ "text": "Strive not to be a success, but rather to be of value.", "author": "Albert Einstein" },
{ "text": "Two roads diverged in a wood, and I—I took the one less traveled by, And that has made all the difference.", "author": "Robert Frost" },
{ "text": "I attribute my success to this: I never gave or took any excuse.", "author": "Florence Nightingale" },
{ "text": "You miss 100% of the shots you don't take.", "author": "Wayne Gretzky" },
{ "text": "I've missed more than 9000 shots in my career. I've lost almost 300 games. 26 times I've been trusted to take the game winning shot and missed. I've failed over and over and over again in my life. And that is why I succeed.", "author": "Michael Jordan" },
{ "text": "The most difficult thing is the decis
@dwayne
dwayne / 0-Start.elm
Last active April 30, 2017 13:36
Elm: Formatting a value as money
module Main exposing (..)
import Html exposing (..)
main =
view init
-- MODEL
@dwayne
dwayne / vagrant.md
Last active June 25, 2016 11:09
Vagrant and VirtualBox
@dwayne
dwayne / Vagrantfile
Last active January 27, 2021 18:02
Play with Python 3.5.1 in Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = 'ubuntu/trusty64'
config.vm.provision 'shell', path: 'install-python'
end
@dwayne
dwayne / install.md
Last active December 9, 2020 20:48
Python Dev

Installing Python from source on Ubuntu

For whatever reason you may want to upgrade your version of Python that came with your Ubuntu distro. However, completely replacing the system version is not recommended. Here is how to install Python for the local user.

Python 2.7.10

$ mkdir ~/local/python-2.7.10
$ cd ~/Downloads
@dwayne
dwayne / getting-started.md
Last active February 23, 2017 18:49
Django Notes (Python 3.5.1 and Django 1.9.x)

Getting Started

Install Python, follow the steps here.

Steps I take when beginning a new Django project.

$ mkdir [project_name]_project
$ cd [project_name]_project
@dwayne
dwayne / getting-started.md
Last active September 15, 2015 08:41
Discourse Notes

Getting Started with Discourse on Ubuntu 14.04 LTS

Software you need

The process

@dwayne
dwayne / 0-how-cookies-work.md
Created July 31, 2015 20:57
Understanding HTTP Cookies

I will use the simple Sinatra application below to explain.

First, we run the app.

$ ruby app.rb

This launches a server at localhost:4567.

@dwayne
dwayne / trello-css-guide.md
Last active August 29, 2015 14:26 — forked from bobbygrace/trello-css-guide.md
Trello CSS Guide

Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

This is where any fun you might have been having ends. Now it’s time to get serious and talk about rules.

Writing CSS is hard. Even if you know all the intricacies of position and float and overflow and z-index, it’s easy to end up with spaghetti code where you need inline styles, !important rules, unused cruft, and general confusion. This guide provides some architecture for writing CSS so it stays clean and ma