Skip to content

Instantly share code, notes, and snippets.

View LibertysYarn's full-sized avatar

Liberty LibertysYarn

View GitHub Profile
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.conf import settings
from django.utils.encoding import force_unicode
import redis
class SessionStore(SessionBase):
""" Redis store for sessions"""
def __init__(self, session_key=None):
self.redis = redis.Redis(
@LibertysYarn
LibertysYarn / Stitched.html
Created May 27, 2013 01:57
Stitched Look - from CSS-Tricks.com
<div class="stitched">
Stitched
</div>
@LibertysYarn
LibertysYarn / Corner-Ribbon.css
Created May 27, 2013 02:00
Corner Ribbon - from CSS-Tricks.com
.wrapper {
margin: 50px auto;
width: 280px;
height: 370px;
background: white;
border-radius: 10px;
-webkit-box-shadow: 0px 0px 8px rgba(0,0,0,0.3);
-moz-box-shadow: 0px 0px 8px rgba(0,0,0,0.3);
box-shadow: 0px 0px 8px rgba(0,0,0,0.3);
position: relative;
@LibertysYarn
LibertysYarn / Ribbon.css
Created May 27, 2013 02:03
Ribbon - from CSS-Tricks.com
.ribbon {
font-size: 16px !important;
/* This ribbon is based on a 16px font side and a 24px vertical rhythm. I've used em's to position each element for scalability. If you want to use a different font size you may have to play with the position of the ribbon elements */
width: 50%;
position: relative;
background: #ba89b6;
color: #fff;
text-align: center;
@LibertysYarn
LibertysYarn / drop-cap.css
Created May 27, 2013 02:15
Drop Caps - from CSS-tricks.com
p:first-child:first-letter { float: left; color: #903; font-size: 75px; line-height: 60px; padding-top: 4px; padding-right: 8px; padding-left: 3px; font-family: Georgia; }
@LibertysYarn
LibertysYarn / layered paper.html
Created May 27, 2013 02:18
Layered Paper - from CSS-tricks.com
<div class="layered-paper">
Howdy
</div>
@LibertysYarn
LibertysYarn / Error.php
Created May 27, 2013 02:26
Custom Error Pages - from CSS-tricks.com
<?php
$status=$_SERVER['REDIRECT_STATUS'];
$codes=array(
400 => array('400 Bad Request', 'The request cannot be fulfilled due to bad syntax.'),
401 => array('401 Login Error', 'It appears that the password and/or user-name you entered was incorrect.'),
403 => array('403 Forbidden', 'Sorry, employees and staff only.'),
404 => array('404 Missing', 'We\'re sorry, but the page you\'re looking for is missing, hiding, or maybe it moved somewhere else and forgot to tell you.'),
405 => array('405 Method Not Allowed', 'The method specified in the Request-Line is not allowed for the specified resource.'),
408 => array('408 Request Timeout', 'Your browser failed to send a request in the time allowed by the server.'),
@LibertysYarn
LibertysYarn / retro image.html
Created May 27, 2013 02:34
Retro image effect - from line25.com
<div class="retro">
<img src="images/retrofy-me.jpg" alt="Retro is cool!" />
</div>
@LibertysYarn
LibertysYarn / flat-menu.css
Created May 27, 2013 02:36
Flat Menu - from line25.com
nav ul {
list-style: none; overflow: hidden; position: relative;
}
nav ul li {
float: left; margin: 0 20px 0 0;
}
nav ul li a {
display: block; width: 120px; height: 120px;
background-image: url(icons.png); background-repeat: no-repeat;
}
@LibertysYarn
LibertysYarn / retro-navbar.css
Created May 27, 2013 02:41
Retro Navbar - from CodePen.io
/*
* Copyright (c) 2012-2013 Arbaoui Mehdi
* http://www.depotwebdesigner.com
*/
body {
padding:5px;
font-family: Georgia;
}
#navigation {