Skip to content

Instantly share code, notes, and snippets.

View c7tincu's full-sized avatar
🖤

Cristian Tincu c7tincu

🖤
  • Bucharest, Romania
View GitHub Profile
@paulirish
paulirish / bling.js
Last active May 1, 2024 19:56
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@vpalos
vpalos / get-field.js
Last active December 16, 2015 05:59
Universal field getter for JavaScript objects.
/**
* Universal field getter method for JavaScript objects.
* @param {Object} _path The field path inside `this`.
* @param {...} _default The default value to be returns if field is not found.
* @return {...} Returns the found field value else `_default` else `undefined`.
*/
Object.prototype._ = Object.prototype._ || function(_path, _default) {
var value = _path.split('.').reduce(
function(hash, field) {
return hash && hash[field]
@addyosmani
addyosmani / cranium.js
Last active February 7, 2019 15:02
Cranium
/* Cranium MVC
* A minimalist MVC implementation written for
* demonstration purposes at my workshops
* http://addyosmani.com
* Copyright (c) 2012 Addy Osmani; Licensed MIT */
var Cranium = Cranium || {};
// Set DOM selection utility