Skip to content

Instantly share code, notes, and snippets.

View daz-codes's full-sized avatar

DAZ daz-codes

View GitHub Profile
m[c=rand(3)]
@daz-codes
daz-codes / gist:1974885
Created March 4, 2012 21:33
Sinatra configure block
########### configuration & settings ###########
configure do
set :name, ENV['NAME'] || 'DAZ4126'
set :author, ENV['AUTHOR'] || 'DAZ'
set :analytics, ENV['ANALYTICS'] || 'UA-XXXXXXXX-X'
set :javascripts, %w[ ]
set :fonts, %w[ Abel ]
set :markdown, :layout_engine => :slim
end
@daz-codes
daz-codes / gist:1977159
Created March 5, 2012 07:08
DAZ4126 route and view
########### DAZ4126 website ###########
require 'bundler'
Bundler.require
get '/' do
@title = "DAZ, Made in Manchester"
slim :index
end
__END__
@daz-codes
daz-codes / gist:1977164
Created March 5, 2012 07:10
Quotes for DAZ4126
@@quote1
blockquote rel="http://www.flickr.com/photos/nativephotography/4343566244/" We Do Things Differently Here
cite Anthony H Wilson
@@quote2
blockquote rel="http://shop.visitmanchester.com/store/product/2265/Quote-magnet---dark-blue/" They return the love around here, don't they?
cite Guy Garvey
@@quote3
blockquote rel="http://shop.visitmanchester.com/store/product/2265/Quote-magnet---dark-blue/" It All Comes from Here
@daz-codes
daz-codes / gist:1977169
Created March 5, 2012 07:11
DAZ4126 error pages
@@404
h1 404!
p That page is missing
@@500
h1 500 Error!
p Oops, something has gone terribly wrong!
@daz-codes
daz-codes / gist:1977171
Created March 5, 2012 07:12
DAZ4126 SCSS settings
$normalfont: "Courier New", "Nimbus Mono L", Monospace;
$headingfont: Abel,"Liberation Sans",Helvetica ,Arial, "Nimbus Sans L", FreeSans, Sans-serif;
$basefontsize: 13px;
$thickness:6px;
$width: 90%;
$mainwidth: 62%;
$sidebarwidth: 32%;
@daz-codes
daz-codes / gist:1977173
Created March 5, 2012 07:13
DAZ4126 SCSS colors
$grey:#A1A794;
$yellow:#F1E166;
$banner:$yellow;
@daz-codes
daz-codes / gist:1977175
Created March 5, 2012 07:14
DAZ4126 SCSS mixin
@mixin links($color:white,$hovercolor:red,$background:$color){
a,a:link,a:visited{
text-decoration: underline;
text-shadow: none;
color:$color;
&:hover{
background: $background;
color:$hovercolor;
}
}
@daz-codes
daz-codes / gist:1977178
Created March 5, 2012 07:14
DAZ4126 Contact form code
post '/' do
require 'pony'
Pony.mail(
from: "DAZ4126<[email protected]>",
to: '[email protected]',
subject: "A message from the DAZ4126 website",
body: params[:message],
port: '587',
via: :smtp,
via_options: {
@daz-codes
daz-codes / gist:1977181
Created March 5, 2012 07:15
DAZ4126 add pages code
get '/:page' do
if File.exists?('views/'+params[:page]+'.slim')
slim params[:page].to_sym
elsif File.exists?('views/'+params[:page]+'.md')
markdown params[:page].to_sym
else
raise error(404)
end
end