Skip to content

Instantly share code, notes, and snippets.

View captainkovalsky's full-sized avatar
😃
I restored my old github WOW

Viktor Dzundza captainkovalsky

😃
I restored my old github WOW
View GitHub Profile
var hasPermission = function hasPermission(permission) {
var mockUser = {
role: 'ADMIN'
};
var rolePermissions = {
'ADMIN': ['viewEmail'],
'ADMIN2': ['editEmail']
};
<load-component
[loadingMessage]="'Loading customers'"
[errorMessage]="'Problem during loading customer list'"
[emptyMessage]="'There are no customer'">
<customer-list (onload)="loaded()"
(onerror)="error()"
(onempty)="empty()"></customer-list>
</load-component>
@captainkovalsky
captainkovalsky / load-component
Created February 28, 2017 13:48
Example of composition load component and child
<load-component
[loadingMessage]="'Loading customers'"
[errorMessage]="'Problem during loading customer list'"
[emptyMessage]="'There are no customer'">
<customer-list (onload)="loaded()"
(onerror)="error()"
(onempty)="empty()"></customer-list>
</load-component>
{
// autoformat on save
"autoformat": true,
// array of extensions for autoformat
"extensions": ["js", "sublime-settings", "jsx"],
// options for jsfmt
"options": {
"preset": "jquery",
{
"name": "myapp",
"version": "0.0.0",
"dependencies": {
"classnames": "^2.1.3",
"dev": "^0.1.3",
"flux": "^2.0.3",
"grunt": "^0.4.5",
"gulp": "^3.9.0",
"immutable": "^3.7.4",
viktor@viktor-pc:~/Projects/github/LRN-React$ npm test
> myapp@0.0.0 test /home/viktor/Projects/github/LRN-React
> jest
== NOTICE: ==
Node and io.js will be merging. http://bit.ly/1dOjLVK
On August 1st, 2015, Jest v0.5.x will work only on io.js until the merger is complete
Legacy v0.4.x for Node 0.10.x will still be available on
function applyFilter(filters){
var f1 = function(phone){
return phone.price >= 60;
};
var f2 = function(phone){
return phone.price <= 70;
};
var phones = [{price: 61, name: '1'}, {price: 89, name: 'exclude'}, {price: 67, name: '2'}];
{
"name": "databits",
"version": "0.0.0",
"dependencies": {
"angular": "1.3.16",
"json3": "~3.2.6",
"es5-shim": "~2.1.0",
"jquery": "~1.11.0",
"bootstrap-sass-official": "~3",
"angular-resource": "1.3.16",
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
console.clear();