Skip to content

Instantly share code, notes, and snippets.

@johnstew
johnstew / gmaps.html
Created February 19, 2014 20:26
Google Maps Getting Started
<style type="text/css">
#map-canvas {
height: 100%;
margin: 0px;
padding: 0px
}
#map-container{
display: block;
width: 100%;
height: 300px;
foreach ($form['submitted'] as $key => $value) {
if (isset($form['submitted'][$key])) {
$types = array('textfield', 'webform_email', 'textarea', 'select');
if (isset($value['#type']) && in_array($value['#type'], $types)) {
$form['submitted'][$key]['#attributes']['placeholder'] = t($value['#title']);
}
}
}
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
var input = $(this);
@johnstew
johnstew / SupportedBrowsers
Created October 6, 2014 19:14
Supported Browsers List
IE9+ FF 27.0+ Safari 5+ Chrome 27+ Opera 18+
@johnstew
johnstew / fontsize
Created October 7, 2014 20:12
Mixin for font-size using REM.
@mixin font-size($size){
font-size: $size + px;
font-size: ($size / 16)+ rem;
}
@johnstew
johnstew / view-content
Created October 17, 2014 20:38
Drupal View Content
<?php $content = $view->style_plugin->rendered_fields; ?>
@johnstew
johnstew / designer.html
Last active August 29, 2015 14:07
designer
<link rel="import" href="../core-ajax/core-ajax.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@johnstew
johnstew / canvasboredom.html
Created November 4, 2014 15:12
canvasboredom.html
<!DOCTYPE html>
<html>
<head>
<title>Whatever</title>
</head>
<body>
<canvas id="canvas" width="500" height="500" style="display: block; margin: auto; border: 1px solid #000;"></canvas>
<script type="text/javascript">
var canvas = document.getElementById("canvas"),
@johnstew
johnstew / package.json
Created November 15, 2014 21:06
Basic Package.json
{
"name": "Project-Name",
"version": "0.1.0",
"devDependencies": {
"grunt": "~0.4.5",
"grunt-contrib-sass": "^0.8.1",
"grunt-contrib-watch": "^0.6.1"
}
}