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
<?php
/* Sum Arrays
Write a function that takes an array of numbers and returns the sum of the numbers. The numbers can be negative or non-integer. If the array does not contain any numbers then you should return 0.
#### Examples
Input: [-2.398] Output: -2.398
Input: [1, 5.2, 4, 0, -1] Output: 9.2
Input: [] Output: 0
# linux
rm -rf ~/.config/JetBrains/PhpStorm*/eval/*.evaluation.key ~/.config/JetBrains/PhpStorm*/options/other.xml ~/.java/.userPrefs/jetbrains
@wesolowski
wesolowski / Readme.md
Last active March 15, 2024 10:48
Setup Kali (WSL2)
@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'],
],
@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 / .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() {
<?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 / 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" },
@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 / 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
{