Skip to content

Instantly share code, notes, and snippets.

View pawlik's full-sized avatar
🎯
Focusing

Grzegorz Pawlik pawlik

🎯
Focusing
View GitHub Profile
@pawlik
pawlik / instructions.md
Created September 27, 2021 07:56 — forked from douglasmiranda/instructions.md
Add email to Keybase.io PGP Key (Public Key)

Export your public key:

keybase pgp export > keybase-public.key

Export your private key:

keybase pgp export --secret > keybase-private.key

Keybase proof

I hereby claim:

  • I am pawlik on github.
  • I am gpawlik (https://keybase.io/gpawlik) on keybase.
  • I have a public key ASCFa9P50-3UR37Lr2BLvdPPkMxY6TW8cwPvyq8jLghSOwo

To claim this, I am signing this object:

:medal::medal::medal::medal::medal::medal::medal::medal::medal: :medal::medal::medal::medal::medal::medal::medal::medal::medal: :medal::medal::medal::medal::medal::medal::medal::medal::medal: :medal::medal::medal::medal::medal::medal::medal::medal::medal: :medal::medal::medal::medal::medal::medal::medal::medal::medal: :medal::medal::medal::medal::medal::medal::medal::medal::medal: :medal::medal::medal::medal::medal::medal::medal::medal::medal: :medal::medal::medal::medal::medal::medal::medal::medal::medal: :medal::medal::medal::medal::medal::medal::medal::medal::medal: :medal::medal::medal::medal::medal::medal::medal::medal::medal:

1 | { true }
2 | a := 1
3 | { a = 1 } % comment to clarify your thoughs
@pawlik
pawlik / switch_between_last_git_branches.sh
Created July 25, 2018 14:10
This allows you to switch between latest git branches
alias gsb="select option in `git branch --sort=-committerdate | head -n $(( $LINES / 2 )) | grep -v '*'`; do git checkout $option; break ;done"
# --sort=-committerdate # sorts branches by commit dates (use --sort=-committerdate for opposite direction)
# $(( $LINES / 2 )) # use half of your terminal height (I like to have some context preserved).
# use -n 100000000 to use all terminal space (select will reduce the number of options for you)
# grep -v '*' - exclude the current branch, if you remove this you have to accomodate the '*' char in $option
# break - remove this if you want to switch, and the immediatelly be given option to switch again :D (just a joke, it's useless without it)
(function() {
// Updates GitHub favicon on pull request pages depending on it's check's status
// if the last checked status was 'pending'
// it will refresh every 5 minutes if you leave the tab
// and will refresh once more when you re-enter it
// if the status was 'success' or 'failure' - it will just update the favicon
is_pending = function() { return !!document.querySelector('.donut-chart>.pending'); };
is_failure = function() { return !!document.querySelector('.donut-chart>.failure'); };
update_favicon = function() {
@pawlik
pawlik / Guardfile
Last active October 3, 2016 11:56
Run related specs whenever you touch shared_example file
# run specs using shared examples after touching shared example itself
watch(%r'spec/support/shared_examples/.*\.rb') do |m|
m.each_with_object([]) do |m, files|
defline = `grep shared_example.*$ #{m}`
shared_example_name = %r[shared_examples ["':](.*)["'] do].match(defline)[1]
new_files =
`grep -r #{shared_example_name} spec/ --include="*_spec.rb" | grep -E "spec/.*_spec\.rb" -o`.split("\n")
files.concat(new_files)
end
class Iterator2ArrayDecorator {
/**
* @var \Iterator
*/
private $iterator;
public function __construct(\Iterator $iterator)
{
$this->iterator = $iterator;
@pawlik
pawlik / ModuleInjectorTest.php
Created April 18, 2013 14:56
POC how to use traits for injecting functionality to objects
<?php
/**
* Created by JetBrains PhpStorm.
* User: gpawlik
* Date: 4/18/13
* Time: 4:42 PM
* To change this template use File | Settings | File Templates.
*/
class ModuleInjectorTest extends PHPUnit_Framework_TestCase {
@pawlik
pawlik / gist:e1b15aa10f8da3bdb5c3
Last active December 8, 2015 07:50
Proposal: include additional step to our release action plan: "composer update"
I would suggest to after step:
"Move incremental configs"
to add step:
"run composer update" and push to master.
Arguments:
- composer update is fairly safe since we moved to explicit versions
- doing so will give us 2 weeks evaluation before next release
(both when developing and when PO evaluates new release candidate)