Skip to content

Instantly share code, notes, and snippets.

@AbeEstrada
Last active Aug 29, 2015
Embed
What would you like to do?
dubizzle
body, .button {
font-family: helvetica, arial, sans-serif;
font-size: 15px;
line-height: 1.5;
}
.button {
background-repeat: no-repeat;
display: inline-block;
font-family: sans-serif;
}
.button.submit {
background-color: green;
background-image: url(../img/icon-tick.png);
background-position: left center;
padding: 10px 5px 15px 10px;
}
.button.cancel {
background-image: url(../img/icon-cancel.png);
background-position: right center;
padding-right: 30px;
}
.button.signup {
background-color: blue;
}
var foo = function() {
this._values = {};
this.set = function(key, value) {
this._values[key] = value;
};
this.get = function(key) {
return this._values[key];
};
};
var instance = new foo();
instance.set('key', 'value');
console.log(instance.get('key'));
instance.key;
var instance2 = new foo();
instance2.set('key', 'value2');
console.log(instance2.get('key'));
instance2.key;
var paths = [
{ name: 'icon', type: 'jpeg', path: '../' },
{ name: 'badge', type: 'gif', path: '../' },
{ name: 'pattern', type: 'jpeg', path: '../' },
{ name: 'boy', type: 'png', path: '../' },
{ name: 'logo', type: 'gif', path: '../' },
{ name: 'bg', type: 'jpeg', path: '../' },
{ name: 'something', type: 'gif', path: '../' },
{ name: 'button', type: 'png', path: '../ ' }
];
var sortPaths = function(paths) {
var o = {};
for (var i = 0; i < paths.length; i++) {
var path = paths[i];
if (path.type in o === false) {
o[path.type] = [];
}
o[path.type].push(path.path+path.name+'.'+path.type);
};
return o;
};
var sortedPaths = sortPaths(paths);
console.log(sortedPaths);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment