Skip to content

Instantly share code, notes, and snippets.

View redthor's full-sized avatar

Douglas Reith redthor

View GitHub Profile
@redthor
redthor / PHP-Array.groovy
Last active February 10, 2020 21:52 — forked from pthiers/PHP-Array.groovy
datagrip php array extractor
/*
* Available context bindings:
* COLUMNS List<DataColumn>
* ROWS Iterable<DataRow>
* OUT { append() }
* FORMATTER { format(row, col); formatValue(Object, col) }
* TRANSPOSED Boolean
* plus ALL_COLUMNS, TABLE, DIALECT
*
* where:
@redthor
redthor / pipelines-status.sh
Last active December 14, 2022 14:59
Bash script for getting bitbucket pipeline status
#!/bin/bash
#
# I made this because bitbucket does not a have a team view on all the
# pipeline builds.
#
# See https://community.atlassian.com/t5/Bitbucket-questions/Where-can-I-get-a-view-of-all-the-pipeline-builds-for-a-team/qaq-p/786264
#
# Requires curl and jq
#
# Use it like this:
@redthor
redthor / delete_branches_older_than.sh
Last active September 15, 2020 12:49
Script to delete branches older than a certain date, modification of 4586456
# Copy of https://gist.github.com/antonio/4586456
# With a modification to collect all the branch names so we can make one git request
# Set DRY_RUN=1 to get an echo of the command
# Format that works with `git log --since`, e.g. 2018-01-01
date=$1
branches=
for branch in $(git branch -a | sed 's/^\s*//' | sed 's/^remotes\///' | grep -v 'master$'); do
@redthor
redthor / pre-push
Last active November 13, 2017 12:29
remote="$1"
url="$2"
z40=0000000000000000000000000000000000000000
# Don't bother unless this is origin
if [ "$remote" != "origin" ]
then
exit 0
fi
@redthor
redthor / GH1525Test.php
Created January 9, 2017 12:54
GH1525Test with ID strategy NONE on parent
<?php
namespace Doctrine\ODM\MongoDB\Tests\Functional\Ticket;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
class GH1525Test extends \Doctrine\ODM\MongoDB\Tests\BaseTest
{
public function testEmbedClone()
@redthor
redthor / symfony_doctrine_dump_individual_files.txt
Created July 5, 2012 02:21
To change symfony 1.4 and doctrine to support dumping individual tables and selecting which models will be dumped
cd $SF_HOME/lib/vendor/symfony/lib/plugins
$ svn status |grep '^M'
M sfDoctrinePlugin/config/sfDoctrinePluginConfiguration.class.php
M sfDoctrinePlugin/lib/task/sfDoctrineDataDumpTask.class.php
M sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Cli.php
M sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Task/DumpData.php
M sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Core.php
$ for a in `svn status |grep '^M' |awk '{print $2}'`;