Skip to content

Instantly share code, notes, and snippets.

%meta(name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1")
@matthewcopeland
matthewcopeland / 0_checkbox_radio.haml
Created September 15, 2012 06:32
Custom checkboxes and radio buttons with haml and sass. For more, see http://github.com/matthewcopeland/sassy-seeds
%fieldset
%span.checkbox-wrapper
%input{ :type=>"checkbox" }
%span
%label A Checkbox
%fieldset
%span.checkbox-wrapper
%input{ :type=>"checkbox", :checked=>"checked" }
%span
@matthewcopeland
matthewcopeland / deploy.rb
Created September 29, 2012 07:09
Example capistrano deploy.rb, based on Ryan Bates' example http://railscasts.com/episodes/335-deploying-to-a-vps
require "bundler/capistrano"
server "96.126.100.112", :web, :app, :db, primary: true
set :application, "capteste"
set :user, "deployer"
set :deploy_to, "/home/#{user}/apps/#{application}"
set :deploy_via, :remote_cache
set :use_sudo, false
set :port, "3030"
@matthewcopeland
matthewcopeland / 00_application.scss
Created October 5, 2012 19:32
File structure of adding a source-sans-page to the sassy-seeds demo app.
// top of the main file
// google fonts/external files must be imported in the root file.
@import url(http:/\/fonts.googleapis.com/css?family=Exo:100,200,300,400,500,600,700,800,900,300italic,400italic,500italic,600italic,700italic,800italic,900italic,200italic,100italic);
// @import source sans link from google fonts.
@matthewcopeland
matthewcopeland / 01_has_whitespace.html
Created October 10, 2012 19:56
Eliminate html whitespace with this little trick. Plus the simplified version in haml. Putting the closing-tag and next opening-tag on the same line kills the whitespace.
<div>
<p>These divs have white space between them.</p>
</div>
<div>
<p>Because html naturally creates whitespace on the line-breaks.</p>
</div>
<!-- with comments -->
<div>
@matthewcopeland
matthewcopeland / 01_svg_wip.html.erb
Created October 22, 2012 22:07
WIP - svg spike for rose chart.
<h1>SVG Spike</h1>
<% # rose chart trig
rose_chart_size = 500
# faux variables
dist1 = 100/2
dist2 = 200/2
dist3 = 300/2
dist4 = 400/2
dist5 = 500/2
@matthewcopeland
matthewcopeland / 01_terminal
Created November 6, 2012 18:03
Postgres start/stop commands
# Start Postgres
$ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
# Stop Postgres
$ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log stop
$campfire: image-url("campfire.png");
$campfire-2x: image-url("[email protected]");
$star: image-url("star.png");
$tree: image-url("tree.png");
$campfire-logo: image-url("campsite.png");
$next-arrow: image-url("travel-camp-to-left.png");
$prev-arrow: image-url("travel-camp-to-right.png");
$ants-fruits-flowers-eggs: image-url("ants-fruits-flowers-eggs.png");
$boomerang: image-url("boomerang.png");
@matthewcopeland
matthewcopeland / animation.scss
Created December 12, 2012 07:16
A fun animation with sass loops.
$campfire-size: 100px;
#campfire {
position: fixed;
right: $gutter;
bottom: $gutter/2;
height: $campfire-size;
width: $campfire-size;
background: $campfire-2x;
background-size: 100%;
}//#campfire
@matthewcopeland
matthewcopeland / color_loops.scss
Created December 21, 2012 11:43
This is a utility shows the use of a variable array, the native sass length-function, and a @mixin that uses @if and @for loops to apply colors to some svg and elements in a consistent order.
// color palette.
$white: #ffffff;
$grey: #ccc;
$greyblue: #5C6F7B;
$blackblue: #162934;
$lightblue: #29AAE2;
$darkblue: #006FAB;
$lightgreen: #B1BA1D;
$darkgreen: #8D8A00;
$brightred: #C4122F;