Skip to content

Instantly share code, notes, and snippets.

View jrencz's full-sized avatar

Jarek Rencz jrencz

  • Wonga
  • Warsaw, Poland
View GitHub Profile
[
{
"name": "demos",
"data": {
"someKey": {
"onlySource": {
"andComponent": {
"know": "demos component content from outside works! And we can use ng bindings here. Component name: {{ $ctrl.name }}. Dynamic content: {{ $ctrl.remoteConfigurationDemoInputValue }}"
}
}
@jrencz
jrencz / package.json
Last active December 27, 2016 10:08
Stats file to be used across many project-related packages. Autoprefixer compatible.
{
"name": "stats",
"version": "0.0.1"
}
@jrencz
jrencz / SassMeister-input.scss
Last active September 15, 2016 10:32
variable interpolations in Sass
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
$color-rebeccapurple: rebeccapurple;
$color-red: red;
$color-blue: blue;
@mixin color(
@jrencz
jrencz / dont-try-this-at-home.js
Created August 17, 2016 16:07
How can one tell well written angular app? When he sees this and it's still ~60fps on a decent laptop
$($window).on('scroll', function () {
scope.$apply(function () {
if ($window.pageYOffset > offsetTop) {
elem.css('left', offsetLeft + 'px');
elem.css('width', width + 'px')
// position: fixed; top: 100px;
elem.addClass('sticky');
} else {
elem.removeClass('sticky');
@jrencz
jrencz / mergePaths.js
Created June 1, 2016 14:04
Lodash: merge property paths given as strings or arrays into one
/**
* @param {...(string|Array)} paths
*
* @example
* > mergePaths('a.b.c', 'd');
* // ['a', 'b', 'c', 'd']
*
* > mergePaths('a.b.c', ['d']);
* // ['a', 'b', 'c', 'd']
*
@jrencz
jrencz / .eslintrc
Created April 12, 2016 12:05
Useful set of words for eslint-plugin-spellcheck
{
"plugins": [
"spellcheck"
],
"rules":
// Spellcheck
//
"spellcheck/spell-checker": ["warn", {
"skipWords": [
// own names
@jrencz
jrencz / angular-di-tests-short-syntax.es6
Created January 21, 2016 10:43
An idea of shorter syntax for loading services in angular1
let $log,
let $q;
// currently:
beforeEach(inject(function (_$log_, _$q_) {
$log = _$log_;
$q = _$q_;
}));
// maybe:
@jrencz
jrencz / finally.js
Created January 7, 2016 11:49
Quick sketch of Angular1 attribute directive that calls a function after a promise returned by ngClick handler is resolved or rejected
(function () {
'use strict';
angular
.module('finally', [])
.directive('finally', function (
$parse
) {
return {
@jrencz
jrencz / q-race.es6
Last active May 7, 2018 08:58
Quick attempt to add spec-compliant race method to Angular $q
(function () {
'use strict';
angular
.module('q.race', [])
.config(function ($provide) {
$provide.decorator('$q', function ($delegate) {
$delegate.race = promises => $delegate((resolve, reject) => {
const bind = promise => {
@jrencz
jrencz / Grunfile-part.js
Created August 20, 2014 08:27
Cofiguration dump for issue #5 on jubalm/grunt-fontello
'use strict';
module.exports = function (grunt) {
grunt.initConfig({
fontello: {
share: {
options: {
config: 'fontello-config.json',
fonts: 'app/fonts',
styles: 'app/core-styles',