Skip to content

Instantly share code, notes, and snippets.

Latam po mieście

Piotr Kowalski piecioshka

Block or report user

Report or block piecioshka

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
archiewald /
Last active Mar 26, 2019
[warn pushing to protected branches] #git
protected_branches=('master' 'develop')
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
for protected_branch in "${protected_branches[@]}"
if [ $protected_branch = $current_branch ]
View gist:6440baf05587761f742d5bfc66cd9224
#!/usr/bin/env bash
cd ./tests
for i in $(ls -d */);
cd ${i};
echo "------------------------------------------"
echo "Testing " ${i}
echo "------------------------------------------"
rsp /
Last active Nov 1, 2018
How to create a Pull Request on GitHub

How to create a Pull Request on GitHub

1. Fork the repository:

![Fork the repo][fork-repo]

2. Select user or organization to fork as:

(if you belong to one or more organizations with appropriate permissions)


I bundled these up into groups and wrote some thoughts about why I ask them!

If these helped you, I'd love to hear about it!! I'm on twitter @vcarl_ or send me an email

Onboarding and the workplace

  • How long will it take to deploy my first change? To become productive? To understand the codebase?
  • What kind of equipment will I be provided? Will the company pay/reimburse me if I want something specific?
rsp /
Last active Apr 8, 2019
Git Strict Flow and GitHub Project Guidelines - setup rules and git flow for commercial and open-source projects by @rsp

Git Strict Flow and GitHub Project Guidelines

Or how to turn this:

into this:

rendfall / angular-tabs.component.ts
Created Sep 28, 2017
Angular 2+ tabsComponent
View angular-tabs.component.ts
import { AfterContentInit, Component, Input, OnChanges, SimpleChanges } from '@angular/core';
interface TabInterface{
active: boolean;
name: string
selector: 'app-tab',
template: `<div class="tab" [hidden]="!active"><ng-content></ng-content></div>`,
myshov / function_invocation.js
Last active Jan 21, 2019
11 Ways to Invoke a Function
View function_invocation.js
(_ => console.log(2))();
eval('console.log(3);');, 4);
console.log.apply(null, [5]);
new Function('console.log(6)')();
Reflect.apply(console.log, null, [7])
Reflect.construct(function(){console.log(8)}, []);, null, [9]);, null, 10);
SitePointEditors / dom-helper.js
Created Mar 28, 2017 — forked from m3g4p0p/dom-helper.js
Mini jQuery, sort of.
View dom-helper.js
* A collection of helper prototype for everyday DOM traversal, manipulation,
* and event binding. Sort of a minimalist jQuery, mainly for demonstration
* purposes. MIT @ m3g4p0p
window.$ = (function (undefined) {
* Duration constants
* @type {Object}
eonil / gist:f6031d17401bd167f28391ccd0642dbe
Created Feb 16, 2017
How to replace string in files in Bash...
View gist:f6031d17401bd167f28391ccd0642dbe
find . -name *.json | xargs sed -i -e 's/\"AAA\"/\"BBB\"/g'
ljharb /
Last active May 5, 2019
Array iteration methods summarized

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.


JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it much simpler to think about both the old list and the new one, what they contain, and

You can’t perform that action at this time.