Skip to content

Instantly share code, notes, and snippets.

Peter Seliger petsel

Block or report user

Report or block petsel

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
View example-of-function-based-mixin-composition-with-class-and-shared-local-state.js
// example-of-function-based-mixin-composition-with-class-and-shared-local-state.js
function withExposableSharedLocalState (state) {
state = ((typeof state === "object") && state) || (void 0);
var json_stringify = JSON.stringify;
var json_parse = JSON.parse;
var compositeType = this;
View Object.getMaxDepth.js
// file "Object.getMaxDepth.js"
const Object = global.Object;
const object_prototype_toString = Object.prototype.toString;
const object_keys = Object.keys;
const math_max = global.Math.max;
const isArray = global.Array.isArray;
View Function.memoize.js
(function (global) {
'use strict';
var
Array = global.Array,
Object = global.Object,
RegExp = global.RegExp,
Function = global.Function,
View Function.clocked.js
(function (global, Math, Function) {
'use strict';
var
DEFAULT_INTERVALL = 200,
TYPEOF_FUNCTION_TYPE = 'function', // assigning the result of (typeof Function) will save two byte if minified.
isFunction = function (type) {
@petsel
petsel / Array.removeFirstMatch.removeLastMatch.removeEveryMatch.js
Created Nov 10, 2017
implementation of 3 filter-method based, prototypal `Array` methods - `Array#removeFirstMatch`, `Array#removeLastMatch`, `Array#removeEveryMatch`.
View Array.removeFirstMatch.removeLastMatch.removeEveryMatch.js
/**
* [Array.removeFirstMatch.removeLastMatch.removeEveryMatch.js]
*
* implementation of 3 filter-method based, prototypal `Array` methods - `Array#removeFirstMatch`, `Array#removeLastMatch`, `Array#removeEveryMatch`.
*/
(function (ReferenceError, TypeError, Object, Array) {
"use strict";
var
@petsel
petsel / esx-trait_example-code_proposal.js.scala
Created Feb 14, 2017
example pseudo code featuring a possible next generation ECMAScript Trait Syntax
View esx-trait_example-code_proposal.js.scala
trait customTrait {
use { Trait_A, Trait_B, Trait_C }
apply all
apply all without { methodName_z, methodName_y }
apply { Trait_A }
@petsel
petsel / Object.compare.js
Created Sep 19, 2016
A generic approach of a possible static `Object.compare` implementation.
View Object.compare.js
(function (Object) {
var
expose_internal_value = Object.prototype.valueOf,
NULL_VALUE = null,
View types.js
(function (Function, Array) {
var
function_prototype = Function.prototype,
isFunction = (function (TYPEOF_FUNCTION) {
return function (type) {
return ((typeof type == TYPEOF_FUNCTION)
&& (typeof type.call == TYPEOF_FUNCTION)
View Range.js
composable("composites.Range", function (require, global) {
"use strict";
require("environment_extended_introspective_core");
@petsel
petsel / Object.with.without.js
Created Oct 5, 2015
prototypal object (de)composition methods targeting function based Traits/Mixins working from an [Object] based view as antipode to [Function.call/apply].
View Object.with.without.js
(function (Object, Array) {
"use strict";
var
object_prototype = Object.prototype,
isObject = function is_object (type) {
You can’t perform that action at this time.