Skip to content

Instantly share code, notes, and snippets.

@morningtoast
morningtoast / gruntproto
Last active August 29, 2015 14:14
Gruntfile for prototyping
/* Clover NWUX Prototype Grunt Config
THINGS TO EDIT:
- output.ftp value, should be path on server for FTP upload
- Edit and rename file example.ftppass to .ftppass
*/
module.exports = function(grunt) {
// Config each plugin
grunt.initConfig({
/**
* Simple localStorage with Cookie Fallback
* v.1.0.0
*
* USAGE:
* ----------------------------------------
* Set New / Modify:
* store('my_key', 'some_value');
*
* Retrieve:
@morningtoast
morningtoast / imgregex
Created October 25, 2014 03:43
PHP image url regex
preg_match_all("/(https?:[^)\"]+\.(?:jpg|jpeg)(?![a-z\/]))/i", $item["Body"], $matches);
@morningtoast
morningtoast / compassjs
Created September 23, 2014 18:17
Compass functions. Directions and bearings
var compass = {
distPerDay: 5172,
getDirection: function(deg) {
var dir = "N";
//var cone = 15; // Degrees to offset for NESW
if (deg > 0 && deg <= 15) { dir = "N"; }
if (deg > 15 && deg <= 75) { dir = "NE"; }
if (deg > 75 && deg <= 105) { dir = "E"; }
if (deg > 105 && deg <= 165) { dir = "SE"; }
@morningtoast
morningtoast / phpchain
Last active August 29, 2015 14:06
chaining
<pre>
<?php
include("_dummy.php");
class Lookup {
function __construct() {
$this->base =& get_instance();
$this->ids = array();
@morningtoast
morningtoast / sassplate.scss
Created September 5, 2014 17:01
SASS Boilerplate with comments
// @import "config";
//| STYLESHEET GROUP
//| Secondary information about group
//|
// One-off comment about this rule
.myrule {
@morningtoast
morningtoast / 7xgrid.html
Last active August 29, 2015 14:05
7x grid
<html>
<head>
<title>Stylesheet Toggling</title>
<style>
* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
.row:after {content: ""; display: table; clear: both; }
.row .col { float: left; }
.row.row--padding > .col { padding:0 15px; }
.row.row--bottom { margin-bottom: 20px; }
@morningtoast
morningtoast / fixed-fluid-columns
Created June 12, 2014 19:45
fixed-fluid columns
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Dynamic Drive: CSS Liquid Layout #2.1- (Fixed-Fluid)</title>
<style type="text/css">
@morningtoast
morningtoast / modaloverlay
Last active August 29, 2015 14:02
Modal overlay background
<div class="overlay" tabindex="-1"></div>
.overlay {
@include opacity (70, .70); // enabled
z-index:998; // enabled
z-index: -1;
position: fixed;
left: 0;
top: 0;
width: 100%;
/*
Content Toggler
Show/hides content as specified in the target elements by data attribute
5/21/14 ~BV
The target elements must have the attribute "toggler" with a value
that is the selector of the content you want to show/hide when
the trigger is clicked.
Markup example: