Skip to content

Instantly share code, notes, and snippets.

Matt Smith AllThingsSmitty

Block or report user

Report or block AllThingsSmitty

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@AllThingsSmitty
AllThingsSmitty / localStorage.js
Last active Apr 19, 2016
Retrieving localStorage from the client
View localStorage.js
'use strict';
function getStorage(type) {
var storage = window[type + 'Storage'],
delta = 0,
li = document.createElement('li');
if (!window[type + 'Storage']) {
return;
}
View ie7-border-box-mixin.scss
/* Thank god no ones uses IE7 anymore, amirite */
@mixin IE7Padding($width: null, $unit: 1px, $paddingLeft: 0, $paddingRight: 0) {
@if $padding == 0 and $paddingRight != 0 {
padding-right: $paddingRight * $unit;
width: $width * $unit;
.lt-ie8 & {
padding-right: $paddingRight + $unit;
width: ($width = $paddingRight) * $unit;
}
}
@AllThingsSmitty
AllThingsSmitty / index.html
Last active Aug 29, 2015
Animated spinning loader
View index.html
<div class="spinner bar">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
@AllThingsSmitty
AllThingsSmitty / picture-element.htm
Last active Aug 29, 2015
An example of how to implement the <picture> element
View picture-element.htm
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Picture Element</title>
<style>
@media all {
#pictureElement {
background-image: image-set(small-1.jpg 1x, small-2.jpg 2x);
}
@AllThingsSmitty
AllThingsSmitty / README.md
Last active Aug 29, 2015
Implementing the Geolocation API with Google Maps API
View README.md

Once you've called the GoogleMap function, you can set ID, height, and width of the map (mapcanvas.id, mapcanvas.style.height and mapcanvas.style.width). You can set map default functionality like zoom, position, and control under var myOptions:

var myOptions = {
  zoom: 15,
  center: latlng,
  mapTypeControl: false,
  navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL},
  mapTypeId: google.maps.MapTypeId.ROADMAP
};
@AllThingsSmitty
AllThingsSmitty / box-sizing-grid.htm
Last active Aug 29, 2015
Creating a grid using box-sizing in CSS3
View box-sizing-grid.htm
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Box-Sizing Grid</title>
<style>
.row:after {
clear: both;
content: "";
display: block;
@AllThingsSmitty
AllThingsSmitty / index.htm
Last active Aug 29, 2015
Experimenting with AngularJS filters
View index.htm
<!DOCTYPE html>
<html ng-app="myApp">
<head>
<meta charset="utf-8">
<title>AngularJS application template</title>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open\+Sans">
</head>
<body ng-controller="MyAppController">
@AllThingsSmitty
AllThingsSmitty / README.md
Created Mar 28, 2014
How to get the Google Translate API free
View README.md

I'm looking to use the Google Translate API but that service isn't free. I need to find a way of utilizing it or some alternative.

@AllThingsSmitty
AllThingsSmitty / grid.scss
Last active Apr 19, 2016
A grid system using Sass and calc()
View grid.scss
// Here is a grid system
// Relying on `calc()` (http://caniuse.com/#search=calc)
// and advanced CSS selectors (http://caniuse.com/#feat=css-sel3)
// Expect it to work on IE9+, Android 4.4+ and any other browsers
// Applying a clean box-model to all elements
* {
box-sizing: border-box;
}
@AllThingsSmitty
AllThingsSmitty / README.md
Last active Aug 29, 2015
Getting old weather data
View README.md

I'm looking into a way to obtain old weather data. This may work for API's.

You can’t perform that action at this time.