Skip to content

Instantly share code, notes, and snippets.

Avatar

Douglas Reith redthor

View GitHub Profile
@redthor
redthor / PHP-Array.groovy
Last active Feb 10, 2020 — forked from pthiers/PHP-Array.groovy
datagrip php array extractor
View PHP-Array.groovy
/*
* 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 Jun 26, 2018
Bash script for getting bitbucket pipeline status
View pipelines-status.sh
#!/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 Sep 15, 2020
Script to delete branches older than a certain date, modification of 4586456
View delete_branches_older_than.sh
# 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
View pre-push
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 Jan 9, 2017
GH1525Test with ID strategy NONE on parent
View GH1525Test.php
<?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 Jul 5, 2012
To change symfony 1.4 and doctrine to support dumping individual tables and selecting which models will be dumped
View symfony_doctrine_dump_individual_files.txt
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}'`;