Skip to content

Instantly share code, notes, and snippets.

View qaraluch's full-sized avatar
👩‍💻
format c:

Ej.Gee qaraluch

👩‍💻
format c:
View GitHub Profile
@qaraluch
qaraluch / eslintrc.js
Created July 27, 2016 05:08
js: eslint config
module.exports = {
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaFeatures": {
@qaraluch
qaraluch / index.html
Last active July 16, 2016 15:00 — forked from anonymous/index.html
Observer pattern (pierwsze podejście) - DP - JS Bin// source https://jsbin.com/vavuho
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
p {
font-family: consolas, Arial, Helvetica, sans-serif;
font-size: 12px;
@qaraluch
qaraluch / strateg-checker.js
Created July 6, 2016 18:42
js: #designpatterns fn checker for strategy
/**
* Checker dla strategy pattern.
* Gdy mamy maciezystaFn(aparm, fn, fnArgs)
* Sprawdza czy istnieje takie fn i zapisuje argumenty
* Pierszy Param nieistotny. Zmienić gdy niepotrzebny
*/
this.fnParams = [].slice.call(arguments, 2);
this.fnName = [].slice.call(arguments, 1, 2);
this.checkedFn = typeof XXX[this.fnName] === 'function' ? true : logger.log('error', `this function: '${this.fnName}' not found in XXX`);
this.fn = this.checkedFn && XXX[this.fnName];
@qaraluch
qaraluch / factory 2 simple.js
Last active May 20, 2016 18:42
js: #designpatterns factory 2 simple
"use strict";
Obj = Obj || {
init: function init() {
this.id = V3.utils.generateID(this.countNo);
this.countNo = 0;
this.components = {};
}
};
@qaraluch
qaraluch / boilerplate-module.js
Created May 20, 2016 18:08
js: #boilerplate module broswer
"use strict";
/*
==========================================================================
XXX
==========================================================================
*/
@qaraluch
qaraluch / .bowerrc
Created May 11, 2016 11:53
bower config
{
"directory" : "lib"
}
@qaraluch
qaraluch / loopObj.js
Created May 9, 2016 17:48
js: loop through obj
for (let key in obj) {
if (obj.hasOwnProperty(key)){
}
}
@qaraluch
qaraluch / internal-strategy2.js
Created May 9, 2016 15:11
js: #designpatterns internal strategy2 (by Elliot)
var bigO = {
methods: {
init: function(args){
return 'init...' + args;
},
},
greet: function(options){
@qaraluch
qaraluch / 06-DP-factory-snippet.js
Last active May 13, 2016 10:56
js: #designpatterns factory
"use strict";
var obj = obj || {
entity: {
setParameters: function setParameters(aobj) {
this.entiType = 'entity';
this.x = aobj.x || 1;
}
},
}
@qaraluch
qaraluch / 06-create.js
Last active April 29, 2016 06:48
js: create obj
createX: function createX(options) {
var thisObj = Object.create(this);
thisObj.init(options);
return thisObj;
}