Skip to content

Instantly share code, notes, and snippets.

View teddyzetterlund's full-sized avatar

Teddy Zetterlund teddyzetterlund

View GitHub Profile

Rekommenderade bloggar

HTML, CSS, JavaScript & UX

Gränssnittsdesign och användarbarhet

@teddyzetterlund
teddyzetterlund / README.markdown
Last active June 25, 2019 05:45
My CodeBrawl Entry: Command line TODO lists

Do It - Simple Todo List

Do It is a simple todo list application written for the command-line. Right now it doesn't have any fancy features or anything and a simple text-file is probably handier to use for keeping track of your todos. Do It is simply my entry for the Code Brawl competition Command line TODO lists.

Background

This project is my first in more than one way. It's my first entry to Code Brawl and it's my first command-line application. I didn't enter the competition to win it, I entered because it would give me motivation to just jump into it and try to write my first CLI-application.

It turned out I couldn't spare a whole of time this week, but at least I got the essential in and I'm planning on improving this application further and then make it my first gem - just for the sake of learning and experimenting.

@teddyzetterlund
teddyzetterlund / dead-center.css
Created December 10, 2011 19:28
CSS utility classes
/**
* Dead center an image both vertically and horizontally inside
* a containing element.
*
* Notes:
* The dead-center container needs height and width set,
* and the image to be centered can't exceed those dimenstions.
*
* Example:
* <div class="example dead-center">
@teddyzetterlund
teddyzetterlund / README.md
Last active September 18, 2022 06:19
HTML Templates

Base Templates

HTML Templates

A small collection of HTML templates with various attributes to solve the basic needs when starting a new project a new project or prototyping a new front-end feature.

blockquote::after {
content: "— 014\ " attr(cite);
display: block;
text-align: right;
}
@teddyzetterlund
teddyzetterlund / pre_commit.rb
Created June 25, 2012 21:43
Rename to pre_commit and put it in <your-project>/.git/hooks to require commits to follow policy
#!/usr/bin/env ruby
# Compare commit message formatting to formatting policy.
#
# Message should include a Pivotal Story ID reference
# and an optional state change keyword.
#
# Example: [Fixes #12345]
message_file = ARGV[0]
/*
http://snook.ca/archives/html_and_css/handling-overflow
http://www.456bereastreet.com/archive/201206/using_media_queries_to_hide_css3_from_older_browsers/
Tested in:
// Uses fade
- Safari 5.1.7
- Chrome 19
- Opera 12
@teddyzetterlund
teddyzetterlund / README.md
Last active October 12, 2015 18:48
Stylesheets organisation

Stylesheet Organisation Notes

This structure is greatly inspired by [Jonathan Snook][snook]'s book [Scalable and Modular Architecture for CSS][smacss], which is a highly recommended book to read for anyone messing about with CSS in projects of any size.

Keep in mind that what is described in this document is not a framework or library, it's more of a styleguide for everyone to follow when working with front-end code on a project together (or for handing over to someone else later on).

Remember that there is no one true way, but this is a collection of battle tested guidelines and techniques that has proven themselves in the past to help keep your growing collection of front-end components better organised and structured for both small and big teams.

CSS Rule Categories

@teddyzetterlund
teddyzetterlund / README.md
Last active December 10, 2015 22:18
Sass output of nested placeholders

Sass output from nested placeholders

Simple example of nested placeholders in Sass and the unfortunate CSS output it generates.

@teddyzetterlund
teddyzetterlund / figure-counter.css
Created June 26, 2013 05:33
Automatic figure numbering with CSS counters
article {
counter-reset: figures;
}
figure {
counter-increment: figures;
}
figcaption:before {
content: "Fig. " counter(figures) " - "; /* For I18n support; use data-counter-string. */