This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div style="font-family: monospace;font-size: 16px;text-align: center;width: 190px;color: white;background-color: #c00;transform: rotate(45deg);z-index: 9999; position: fixed; top: 30px; right: -50px;font-weight: bold;padding: 5px;cursor: pointer;opacity: 1;" | |
onclick="var s=this.style,p='opacity',t=setTimeout,i=function(){if(s[p]<1){s[p]-=-0.05;s.display='block';t(i,10);}else{s[p]=1;}},o=function(){if(s[p]>0){s[p]-=0.05;t(o,10);}else{s[p]=0;s.display='none';t(i,5e+3);}};o();"> | |
<div style="border: 1px white dashed;">DEVELOPMENT</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[core] | |
excludesfile = ~/.gitignore | |
pager = less -x4 | |
[user] | |
name = Daniel Król | |
email = [email protected] | |
[push] | |
default = simple | |
[merge] | |
ff = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
The MIT License (MIT) | |
Copyright (c) 2017 Daniel Król | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH T |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# ! inverts return code (fails on non-empty grep output) | |
! find . -type f -name '*.php' -exec php -l {} \; | grep -v "No syntax errors detected" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: golang:latest | |
stages: | |
- build | |
- test | |
before_script: | |
- go get github.com/tools/godep | |
- mkdir -p /go/src/gitlab.com | |
- cp -r /builds/$CI_PROJECT_NAMESPACE /go/src/gitlab.com/ | |
- cd /go/src/gitlab.com/$CI_PROJECT_PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
git log --graph --all --pretty=oneline --decorate --abbrev-commit --shortstat | |
# git config --global alias.tree "log --graph --all --pretty=oneline --decorate--abbrev-commit --shortstat" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function logColor(color, args) { | |
console.log(`%c ${args.join(' ')}`, `color: ${color}`); | |
} | |
const log = { | |
aliceblue: (...args) => { logColor('aliceblue', args)}, | |
antiquewhite: (...args) => { logColor('antiquewhite', args)}, | |
aqua: (...args) => { logColor('aqua', args)}, | |
aquamarine: (...args) => { logColor('aquamarine', args)}, | |
azure: (...args) => { logColor('azure', args)}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function render($template, $vars) { | |
return \preg_replace_callback("!{{\s*(?P<key>[a-zA-Z0-9_-]+?)\s*}}!", function($match) use($vars){ | |
return isset($vars[$match["key"]]) ? $vars[$match["key"]] : $match[0]; | |
}, $template); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function array_permute($arrays) { | |
$set = array_shift($arrays); | |
foreach($arrays as $sub) { | |
$newSet = []; | |
foreach($set as $prefix) { | |
foreach($sub as $suffix){ | |
$newSet[] = $prefix.$suffix; | |
} | |
} |
OlderNewer