Skip to content

Instantly share code, notes, and snippets.

<?php
namespace Tests\Unit;
use TestCase;
class AppVersionTest extends TestCase
{
/**
* @dataProvider elegibleVersionDataprovider
@celosauro
celosauro / github-delete-stale-branches.js
Created June 7, 2022 11:26 — forked from victorlin/github-delete-stale-branches.js
Delete stale branches from the GitHub repo's stale branches page (github.com/user/repo/branches/stale). Originally from https://stackoverflow.com/a/30789283
// Paste in browser console and run
async function deleteStaleBranches(delay=500) {
var stale_branches = document.getElementsByClassName('js-branch-delete-button');
for (var i = 0; i < stale_branches.length; i++)
{
stale_branches.item(i).click();
await new Promise(r => setTimeout(r, delay));
}
}
@celosauro
celosauro / Doctrine.php
Created July 1, 2020 22:30 — forked from jakzal/Doctrine.php
Use Doctrine and Symfony Kernel in phpunit tests
<?php
declare(strict_types=1);
namespace SymfonyLive\Mastermind\Adapters\Database;
use Doctrine\Common\Persistence\ManagerRegistry;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\Tools\SchemaTool;
use RuntimeException;
@celosauro
celosauro / README.md
Created June 23, 2020 21:04 — forked from Tom32i/README.md
Simple list hydrator for Symfony2

Simple list hydrator for #Syfmony2

Sample User repository method that return all user names in an array:

/**
 * Find user names
 *
 * @return array
 */

public function findAllNames()

@celosauro
celosauro / README.md
Created February 7, 2020 23:24 — forked from ColCh/README.md
Create merge request on Gitlab in command line for current branch

Gitlab merge request script

Creates merge request on Gitlab for you

Installation

Download it, add executable perms and place into PATH:

# Place it into ~/.bin
mkdir ~/.bin
@celosauro
celosauro / release.sh
Created February 5, 2020 23:22 — forked from rav94/release.sh
Release a branch from master + updating maven POM file version to new version for multi module project.
#!/bin/bash
# current Git branch
branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
# current project name
projectName=$(git config --local remote.origin.url|sed -n 's#.*/\([^.]*\)\.git#\1#p')
# establish master branch name variables
masterBranch=$branch
@celosauro
celosauro / group_sequencial.php
Created August 23, 2019 12:24
Grouping sequencial numbers in a subarray
$elements = [1, 2, 3, 4, 6, 7, 10, 15, 20, 21, 22, 33];
$groups = [];
$groupKey = 0;
for ($i = 0; $i < count($elements) ; $i++) {
$currenElement = $elements[$i];
$nextElement = $elements[$i + 1];
$groups[$groupKey][] = $currenElement;
if (($currenElement + 1) != $nextElement) {
@celosauro
celosauro / .gitconfig
Last active February 27, 2020 15:50
.gitconfig file
[user]
name =
email =
# username =
[core]
editor = nano
#whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[web]
browser = google-chrome