Skip to content

Instantly share code, notes, and snippets.

View jrencz's full-sized avatar

Jarek Rencz jrencz

  • Wonga
  • Warsaw, Poland
View GitHub Profile
@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 / 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 / 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 / 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"
}
[
{
"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 }}"
}
}