Skip to content

Instantly share code, notes, and snippets.

View michaelparenteau's full-sized avatar
🐢
inspiration

Michael Parenteau michaelparenteau

🐢
inspiration
View GitHub Profile
@michaelparenteau
michaelparenteau / config.ru
Last active January 29, 2016 05:55
Basic Auth Middleman & Heroku
# This is a snippet to add to middleman's config.ru file if you want to add basic auth to your middleman app on heroku
# NOTE: you need to stick this above the build script like shown below
use Rack::Auth::Basic, "Restricted Area" do |username, password|
[username, password] == ['username', 'password']
end
# This part below is just what builds the static site. you only need to add lines 4 - 6 above any build command like shown below.
use Rack::TryStatic, :root => "build", :urls => %w[/], :try => ['.html', 'index.html', '/index.html']
@michaelparenteau
michaelparenteau / sgem.sh
Last active December 15, 2015 22:28
A Bash script that takes an argument to fetch gem data from ruby gems.org. Stick it on your path run. The script uses a ruby gem "jazor" to parse json data, so you will need to have that installed for this to work.
#!/bin/bash
# INFO:
# This script makes a request to rubygems.org for JSON data on a gem
# It uses the ruby gem JAZOR to parse json and then we format the CL
# KEY/VALUE output.
#
# DEPENDENCIES
# Ruby, Rubygems, Bash
#
@michaelparenteau
michaelparenteau / menubar.haml
Created June 20, 2012 21:11
compass menubar mixin
// Here we follow a convention for the styles to apply
// to use the mixin and change markup, you will need to
// modify the scss for everything to work.
// You are free to use any of this, but really it is just an example.
%ul.menubar.black
%li= link_to "first item", "#"
%li
another item (hover me)
%ul
@michaelparenteau
michaelparenteau / paper-stack.haml
Created May 14, 2012 23:27
Compass Paper Stack Mixin
.paper-stack
%h2 Paper Stack
@michaelparenteau
michaelparenteau / _ribbon.scss
Created May 12, 2012 08:36
Compass Ribbon Mixin
// # Compass Ribbon Mixin
// the mixin
@mixin ribbon($color, $ribbon-thickness, $notch-color, $notch-side) {
@include background-image(linear-gradient(lighten($color, 20%), darken($color, 10%)));
@include inline-block;
position: absolute;
padding-#{$notch-side}: $ribbon-thickness;
@if $notch-side == left {
@michaelparenteau
michaelparenteau / _ribbon.scss
Created May 12, 2012 08:28
Compass Ribbon Mixin
// the mixin
@mixin ribbon($color, $ribbon-thickness, $notch-color, $notch-side) {
@include background-image(linear-gradient(lighten($color, 20%), darken($color, 10%)));
@include inline-block;
position: absolute;
padding-#{$notch-side}: $ribbon-thickness;
@if $notch-side == left {
height: $ribbon-thickness;
line-height: $ribbon-thickness;
@michaelparenteau
michaelparenteau / compass-flags.scss
Created May 11, 2012 21:20
Compass Ribbon Mixin
@mixin ribbon($color, $ribbon-thickness, $notch-color, $notch-side) {
@include background-image(linear-gradient(lighten($color, 20%), darken($color, 10%)));
@include inline-block;
position: absolute;
padding-#{$notch-side}: $ribbon-thickness;
@if $notch-side == left {
height: $ribbon-thickness;
line-height: $ribbon-thickness;
right: -2px;
padding-right: 10px;
<!DOCTYPE html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>sidescroll</title>
<link rel="stylesheet" href="http://reset5.googlecode.com/hg/reset.min.css" type="text/css" media="screen" title="no title" charset="utf-8">
<style type="text/css" media="screen">
.wrapper {
overflow-x: scroll;
overflow-y: hidden;
white-space: nowrap;
@michaelparenteau
michaelparenteau / cleaner.haml
Created November 10, 2010 17:24
Just some example erb to haml
%h3 Videos
%ul.sortable
- @videos.each do |video|
%li{ :id => "video_#{video.id}" }= video.title