Skip to content

Instantly share code, notes, and snippets.

Boban Stojanovski boban984

Block or report user

Report or block boban984

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
@boban984
boban984 / object-creation.md
Created Dec 7, 2016 — forked from chip/object-creation.md
Douglas Crockford - Create Object Recipe (2014)
View object-creation.md

Douglas Crockford showed a slide showing how he creates JavaScript objects in 2014.

He no longer uses Object.create(), avoids 'this' and doesn't even care about memory reduction by using prototypes.

https://www.youtube.com/watch?v=bo36MrBfTk4 (skip ahead to 35 mins for relevant section)

Here is the pattern described on the slide:

function constructor(spec) {
@boban984
boban984 / ApplicationBuilderExtensions.cs
Last active May 25, 2016
asp.net core rc2, serve node_modules folder
View ApplicationBuilderExtensions.cs
using Microsoft.Extensions.PlatformAbstractions;
using System.IO;
using Microsoft.Extensions.FileProviders;
using Microsoft.AspNetCore.Hosting;
namespace Microsoft.AspNetCore.Builder
{
public static class ApplicationBuilderExtensions
{
public static IApplicationBuilder UseNodeModules(
@boban984
boban984 / jqueryevents
Created Mar 16, 2014
jQuery get Events
View jqueryevents
function getEvents(sel) {
return $(sel).toArray().reduce(function(acc, el) {
var events = $._data(el, 'events');
if (events) acc.push(events);
return acc;
}, []);
}
function calculateEvents(acc, obj) {
for (key in obj) {
You can’t perform that action at this time.