Skip to content

Instantly share code, notes, and snippets.

@Acts7
Acts7 / difference.js
Created June 20, 2019 14:54 — forked from Yimiprod/difference.js
Deep diff between two object, using lodash
/**
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
function difference(object, base) {
function changes(object, base) {
return _.transform(object, function(result, value, key) {
if (!_.isEqual(value, base[key])) {
@Acts7
Acts7 / best-localStorage-polyfill-evar.js
Created October 16, 2018 21:37 — forked from juliocesar/best-localStorage-polyfill-evar.js
This is the best localStorage polyfill in the world
// I mean, seriously, localStorage is supported even by your mum. How about instead of
// casing the feature out, you give users in-memory (stale) storage instead?
// If they close your application, they deserve to lose data anyway.
// if (!('localStorage' in window)) {
if (!Modernizr.localstorage) {
window.localStorage = {
_data : {},
setItem : function(id, val) { return this._data[id] = String(val); },
getItem : function(id) { return this._data.hasOwnProperty(id) ? this._data[id] : undefined; },
@Acts7
Acts7 / Boxes-and-Lines.markdown
Created March 29, 2015 19:02
Boxes and Lines
@Acts7
Acts7 / Audio-Player.markdown
Created July 13, 2014 18:06
A Pen by Acts7.
@Acts7
Acts7 / SassMeister-input-HTML.html
Created April 4, 2014 18:01
Generated by SassMeister.com.
<div class="col1">
<h1>Main</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsam, nesciunt, odio nemo doloremque maxime aperiam? Perferendis, odio, maxime, magnam accusantium provident veniam ea culpa cum suscipit illum non voluptatum quibusdam.</p>
</div>
@Acts7
Acts7 / Tear-able-Cloth.markdown
Created August 26, 2013 22:22
A Pen by Acts7.