Skip to content

Instantly share code, notes, and snippets.

@smhmic
smhmic / gmail_style_squeeze.css
Created September 25, 2012 16:31
Gmail style tweaks for visibility. This is a hacky little set of CSS styles for Gmail. * The intention was to make 'Compact' view even more compact, especially in the sidebar, toolbar buttons, and message list areas.
/**
* Copyright 2012 by smhmic. All rights reserved.
* @author smhmic@gmail.com
* @date 9/20/2012
*
* This is a hacky little set of CSS styles for Gmail.
* The intention was to make 'Compact' view even more compact, especially in the sidebar, toolbar buttons, and message list areas.
*
* Gmail changes often, but hopefully these styles will continue to work for a wee while!
* It was tested using
@smhmic
smhmic / index.html
Created October 22, 2012 16:59
A CodePen by smhmic. Page Flip modal dialog - an awesome modal dialog shows itself by flipping the whole page and appears on the back like a badge. i made a blog post about it here : http://www.blazeboy.me/2012/10/16/flip-page-modal-dialog/
<div class="flip-container">
<div class="flipper">
<div class="front">
<div id="header" class="clearfix">
<div id="logo">
Flip Dialog
</div>
<div id="menu">
<ul>
@smhmic
smhmic / index.html
Created October 22, 2012 17:01
A CodePen by Marcello Africano. Slidebar - A slippery, sliding, slick navigation bar.
<ul>
<li><a href="#"> &#10047; </a></li><!--
--><li><a href="#"> Lorem </a></li><!--
--><li><a href="#"> Ipsum </a></li><!--
--><li><a href="#"> Consectetur adipisicing </a></li><!--
--><li><a href="#"> Sit amet </a></li>
</ul>
@smhmic
smhmic / index.html
Created October 22, 2012 20:00
A CodePen by smhmic. Graphic Checkbox (All Browsers) - Use two images to indicate the state of a checkbox.
<input type="checkbox" id="cb1" class="graphic" checked />
<label for="cb1"><span class="flag"></span>Checkbox</label>
@smhmic
smhmic / index.html
Created October 22, 2012 20:00
A CodePen by Christophe Benoliel Molina. Push / Check (inspired) - Inspired by a dribbble shot create by Diego Monzon more info: http://dribbble.com/shots/774883-Push-Check?list=following
</br></br>
<div id="warp">
Inspired CSS version of Push / Check
<div class="minimal push">
<label class="check" >
<input class="push-btn" type="checkbox" name="push-btn" value="" checked="checked">PUSH
</label>
</div>
</br></br>
<div class="push">
@smhmic
smhmic / index.html
Created October 22, 2012 20:03
CSS Atom animation
<div class="container">
<div class="wrap">
<div class="circle horizontal c1">
<div class="wrap-electron">
<div class="circle electron"></div>
</div>
</div>
<div class="circle vertical c1">
<div class="wrap-electron">
<div class="circle electron"></div>
@smhmic
smhmic / gist:4277961
Created December 13, 2012 17:01
asynch-requestable php script. Copied from -nathan's comment on http://petewarden.typepad.com/searchbrowser/2008/06/how-to-post-an.html
<?php
/// script can run forever..
set_time_limit(0);
/// tell the client the request has finished processing
header('Connection: close');
@ob_end_clean(); #seems to complain a lot w/o the @
/// continue running once client disconnects
@smhmic
smhmic / .htaccess
Last active May 6, 2021 12:45
basic htaccess rules for pretty URLs and avoiding duplicate content (for a filesystem-based URL structure)
<IfModule mod_rewrite.c>
RewriteEngine On
# Redirect secondary domains
RewriteRule .* - [E=PRIMARY_DOMAIN:________________]
RewriteCond %{HTTP_HOST}==%{ENV:PRIMARY_DOMAIN} !^(.+)==\1$ [NC]
RewriteCond %{REQUEST_URI} ^/?(.*)$
RewriteRule .? http://%{ENV:PRIMARY_DOMAIN}/%1 [L,QSA]
ol {
counter-reset:li; /* Initiate a counter */
margin-left:0; /* Remove the default left margin */
padding-left:0; /* Remove the default left padding */
}
ol > li {
position:relative; /* Create a positioning context */
margin:0 0 6px 2em; /* Give each list item a left margin to make room for the numbers */
padding:4px 8px; /* Add some spacing around the content */
list-style:none; /* Disable the normal item numbering */
@smhmic
smhmic / gist:7934153
Last active December 31, 2015 04:29
get query variable via js
function getParameterByName( name ){
if( typeof getParameterByName.params == 'undefined' )
getParameterByName.params = {};
if( typeof getParameterByName.params[name] == 'undefined' ){
name = name.replace( /[\[]/, "\\\[" ).replace( /[\]]/, "\\\]" );
var regex = new RegExp( "[\\?&]" + name + "(?:=([^&#]*))?" ),
results = regex.exec( location.search );
// if only key was given, assume value is 'true'
if( results === null )
getParameterByName.params[name] = null;