Skip to content

Instantly share code, notes, and snippets.

var i = 0;
function setNewVal(prop) {
window.localStorage[prop + "timestamp"] = new Date();
//console.log(localStorage.sectimestamp + ' 1');
}
function recursive() {
for (var prop in window.localStorage) {
//if the property name contains the string "timestamp"
@kulerbox
kulerbox / SassMeister-input.scss
Last active August 29, 2015 14:23
Generated by SassMeister.com.
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// ----
//border-radius
$radius: 0px;
$home-spacer: 90px;
@kulerbox
kulerbox / sass-map
Last active August 29, 2015 14:21
Sass @each with multiple variables
$zoo: ("puma": black, "sea-slug": green, "egret": brown, "salamander": red);
@each $animal, $color in $zoo {
.#{$animal}-icon {
background-color: $color;
}
}
.platform-android4_1 {
/*Any styles for android 4.1*/
}
.platform-android4_3 {
/*Any styles for android 4.3*/
}
.platform-android4_4 {
/*Any styles for android 4.4*/
@kulerbox
kulerbox / p-moocss
Last active August 29, 2015 14:15
OOCSS-Sass function for margin and padding helper classes
//margin helpers
@for $i from 1 through 50 {
//all margins
.m--#{$i} {
margin: #{$i}px;
}
//top margins
.mt--#{$i} {
//create an array from classes
var jsClass = document.getElementsByClassName("jsClass");
//loop through the length of the array
for (var i = 0; i < jsClass.length; i++) {
//assign a onclick event to each element
jsClass[i].onclick = function() {
//this will be the actual element. So you can use this.id to get the element's id
var thisId = this.id;