Skip to content

Instantly share code, notes, and snippets.

View wesolowski's full-sized avatar
😄
The future starts today, not tomorrow.

Rafał Wesołowski wesolowski

😄
The future starts today, not tomorrow.
View GitHub Profile
@wesolowski
wesolowski / .bashrc
Created April 22, 2014 07:40
My bashrc file
# Configure colors, if available.
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
c_reset='\[\e[0m\]'
c_user='\[\e[1;33m\]'
c_path='\[\e[0;33m\]'
c_git_cleancleann='\[\e[0;36m\]'
c_git_dirty='\[\e[0;35m\]'
else
c_reset=
c_user=
@wesolowski
wesolowski / pre-commit
Created May 23, 2014 10:58
Git Hook | Pre Commit - PHP Lint (Smoke Test)
#!/bin/bash
git diff --cached --name-status --diff-filter=ACMR | while read STATUS FILE; do
if [[ "$FILE" =~ ^.+(php|inc)$ ]]; then
php -l "$FILE" 1> /dev/null
if [ $? -ne 0 ]; then
echo "Aborting commit due to files with syntax errors" >&2
exit 1
fi
fi
<?php
$ip = (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
if($ip === '###IP###') {
dump(__FUNCTION__ .' / '. __FILE__ .' / '. __LINE__);
}
@wesolowski
wesolowski / FirstPlugin.php
Created August 17, 2017 05:44
Shopware-Plugin test
<?php
namespace FirstPlugin;
use Shopware\Components\Plugin;
/**
* Class FirstPlugin
* @package FirstPlugin
*/
class FirstPlugin extends Plugin
{
@wesolowski
wesolowski / gist:02860d61d1b71d2b62e9f9a57b152795
Created October 6, 2017 15:30
docker-compose | install in teamcity-agent
curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
pip uninstall docker-py; pip uninstall docker; pip install docker;
@wesolowski
wesolowski / Default (Windows).sublime-keymap
Last active January 14, 2018 14:03
Sublime Text - Files
[
{ "keys": ["f1"], "command": "goto_documentation" },
{ "keys": ["ctrl+shift+7"], "command": "toggle_comment", "args": { "block": false } },
{ "keys": ["ctrl+shift+y"], "command": "upper_case" },
{ "keys": ["ctrl+shift+x"], "command": "lower_case" },
{ "keys": ["ctrl+shift+c"], "command": "show_panel", "args": {"panel": "console", "toggle": true} },
{ "keys": ["ctrl+alt+a"], "command": "alignment" },
{ "keys": ["ctrl+b"], "command": "toggle_side_bar" },
{ "keys": ["ctrl+shift+d"], "command": "goto_definition" },
{ "keys": ["ctrl+shift+r"], "command": "goto_symbol_in_project" },
<?php
public function _execute(array $params = null)
{
try {
$start = microtime(true);
if ($params !== null) {
$ret = $this->_stmt->execute($params);
} else {
$ret = $this->_stmt->execute();
@wesolowski
wesolowski / .bash_aliases
Last active March 4, 2021 10:29
Cofig file for new comp
# Alias for Windows folder
alias winhome="cd /mnt/c/Users/wesolowski/Desktop/"
alias work="cd ~/workspace"
alias workspace=work
alias nexus="cd ~/workspace/nexus"
phpunit() {
@wesolowski
wesolowski / agent-wget-install.sh
Last active December 29, 2021 08:28
TeamCity docker-compose (Docker in Docker)
docker exec teamcity_agent1 /bin/sh -c 'apt-get update && apt-get install -y wget docker-compose unzip'
docker exec teamcity_agent2 /bin/sh -c 'apt-get update && apt-get install -y wget docker-compose unzip'
docker exec teamcity_agent3 /bin/sh -c 'apt-get update && apt-get install -y wget docker-compose unzip'
@wesolowski
wesolowski / songs_mapping.php
Last active March 24, 2021 09:32
Songs mappinf for wesolowski/symfony-spotify-playlist-updat
<?php
return [
'5WHTFyqSii0lmT9R21abT8' => [
['Mabel', "Don't Call Me Up"],
],
'5Jt9LBya59lo2T9qQ7jfH3' => [
['Katarzyna Nosowska', 'Sobie i Wam'],
['Nosowska/Organek/Zalewski/Igo', 'Sobie i Wam'],
],