Skip to content

Instantly share code, notes, and snippets.

@ricbra
ricbra / upload.sh
Created August 31, 2023 09:24
Bash script to create AWS SSM parameters from JSON file
#!/bin/bash
# Specify the JSON file path, contents should be like:
# { "environment": [ { "name": "DB_PASSWORD", "value": "password" }, { "name": "DB_USERNAME", "value": "username" } ] }
json_file="file.json"
# Loop through each environment object in the JSON file
jq -r '.environment[] | "aws ssm put-parameter --name /prod/app-name/" + .name + " --value " + .value + " --type SecureString"' "$json_file" | while read -r cmd; do
echo "$cmd"
eval "$cmd"
@ricbra
ricbra / keybase.md
Created November 18, 2021 19:22
keybase.md

Keybase proof

I hereby claim:

  • I am ricbra on github.
  • I am rvandenbrand (https://keybase.io/rvandenbrand) on keybase.
  • I have a public key ASA7kFcUn-QqIl6haLwzuDYD5OSQFffTJcshlzljgvNpHwo

To claim this, I am signing this object:

Verifying that +ricbra is my blockchain ID. https://onename.com/ricbra
@ricbra
ricbra / gist:b683f95321bf50bc649e
Last active November 11, 2015 19:49
Install Debian on a MacBook Pro (10,1)
For the fans: https://ineed.coffee/projects/mbpfan/
sudo cp mbpfan.service /usr/lib/systemd/system
sudo cp mbpfan.service /etc/systemd/system/mbpfan.service
sudo systemctl daemon-reload
sudo systemctl start mbpfan.service
sudo systemctl enable mbpfan.service
in /etc/rc.local
setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0
@ricbra
ricbra / CategoryType.php
Last active August 29, 2015 14:27
Translate Entity field labels
<?php
namespace Bkv\Bundle\LbwBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Translation\Translator;
use Symfony\Component\Validator\Constraints\NotBlank;
class CategoryType extends AbstractType
{
@ricbra
ricbra / hack.php
Created August 14, 2015 12:42
How to set violation with array
<?php
namespace SmaakEnSensatie\Validator;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
class DeliveryValidator extends ConstraintValidator
{
public function validate($value, Constraint $constraint)
<?php
/*
* (c) Waarneembemiddeling.nl
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Wb\Bundle\CoreBundle\SwiftMailer;
@ricbra
ricbra / Doctrine.php
Last active August 29, 2015 14:23 — forked from Sitebase/Doctrine.php
\Doctrine\DBAL\Types\Type::addType('uuid', 'BuboBox\Doctrine2\DBAL\Types\UuidType');
<?php
namespace spec\Wb\PoolBundle\Controller;
use Broadway\CommandHandling\CommandBusInterface;
use Broadway\ReadModel\RepositoryInterface;
use Broadway\UuidGenerator\UuidGeneratorInterface;
use Netvlies\WbBundle\Entity\EntityGroupRepository;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
<?php
/*
* (c) Waarneembemiddeling.nl
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Wb\Pool\Model\Member;