Skip to content

Instantly share code, notes, and snippets.

@mazell
mazell / param.htaccess
Created April 8, 2014 08:24
config:htaccess param
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ /power.php?story=$1 [L]
@mazell
mazell / url.js
Created April 8, 2014 07:27
js:urlparam
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
@mazell
mazell / box-shadow-top.css
Created March 14, 2014 08:12
CSS: Box Shadow Top
.shadow {
-moz-box-shadow: inset 0px 40px 40px -40px #ccc;
-webkit-box-shadow: inset 0px 40px 40px -40px #ccc;
box-shadow: inset 0px 40px 40px -40px #ccc;
}
@mazell
mazell / wp-header.php
Created March 3, 2014 10:01
WP: Header template
<!DOCTYPE HTML>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title><?php wp_title( '|', true, 'right' ); ?></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<link rel="stylesheet" href="inc/css/normalize.css">
@mazell
mazell / Angular.html
Created February 21, 2014 12:25
HTML: Angular Boilerplate
<!DOCTYPE html>
<!-- define angular app -->
<html ng-app="zelloutApp">
<head>
<!-- SCROLLS -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" />
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.0/css/font-awesome.css" />
@mazell
mazell / inputbase.scss
Created February 14, 2014 14:38
CSS: Basic Input
.page-template-page-contact-form-php{
input[type=text]{
width: 20%;
border: 1px solid #C0C0C0;
border-radius:10px;
line-height: 1.5em;
padding: 10px;
background: rgba(255,255,255,0.5);
@mazell
mazell / compass.html
Created February 11, 2014 19:05
HTML: Compass Styles
<head>
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css" />
<link href="/stylesheets/print.css" media="print" rel="stylesheet" type="text/css" />
<!--[if IE]>
<link href="/stylesheets/ie.css" media="screen, projection" rel="stylesheet" type="text/css" />
<![endif]-->
</head>
@mazell
mazell / floatingbox.scss
Created February 9, 2014 18:23
SCSS: Floating boxes
.frame{background:#ff3;overflow:hidden;width:100%;}
.box{
//width:90%;
width:160px;
padding-bottom: 160px;
position: relative;
float:left;
margin:8px;
.innerContent{
position: absolute;
@mazell
mazell / HorizontalMenu.css
Created February 7, 2014 14:49
CSS: Horizontal Menu
#navmenu ul {margin: 0; padding: 0;
list-style-type: none; list-style-image: none; }
#navmenu li {display: inline; }
#navmenu a {text-decoration:none; color: #fff; }
#navmenu a:hover {color: #333; }
@mazell
mazell / loadJson.js
Created February 6, 2014 13:18
JS: LoadJson
function loadJSON(callback) {
var xobj = new XMLHttpRequest();
xobj.overrideMimeType("application/json");
xobj.open('GET', 'file.json', true);
xobj.onreadystatechange = function () {
if (xobj.readyState == 4 && xobj.status == "200") {
// .open will NOT return a value but simply returns undefined in async mode so use a callback
callback(xobj.responseText);