Skip to content

Instantly share code, notes, and snippets.

@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@gaearon
gaearon / ReduxMicroBoilerplate.js
Last active March 26, 2020 00:35
Super minimal React + Redux app
import React, { Component } from 'react';
import { createStore, combineReducers, applyMiddleware, bindActionCreators } from 'redux';
import { provide, connect } from 'react-redux';
import thunk from 'redux-thunk';
const AVAILABLE_SUBREDDITS = ['apple', 'pics'];
// ------------
// reducers
// ------------
@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active May 5, 2024 00:12
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@joergviola
joergviola / Global.java
Created May 4, 2012 13:39
Basic Auth a whole Play 2.0 Application
public class Global extends GlobalSettings {
@Override
public Action onRequest(Request arg0, Method arg1) {
return new Action.Simple() {
public Result call(Context ctx) throws Throwable {
String authConf = Config.getString("basic.auth");
if (authConf == null)
return delegate.call(ctx);
String auth = ctx.request().getHeader("Authorization");
@THemming
THemming / gist:2173037
Created March 23, 2012 17:31
init.d script to launch Play framework under CentOS/RedHat
#!/bin/bash
# chkconfig: 345 20 80
# description: Play start/shutdown script
# processname: play
#
# Instalation:
# copy file to /etc/init.d
# chmod +x /etc/init.d/play
# chkconfig --add /etc/init.d/play
# chkconfig play on
@sotarok
sotarok / BehatTest.php
Created February 19, 2012 19:00
Running Behat in the Test Case of PHPUnit on Non-Symfony Application.
<?php
/**
*
* @forked https://gist.github.com/1298503
*/
require_once 'behat/autoload.php';
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\ConsoleOutput;
@jakzal
jakzal / KernelAwareTest.php
Last active October 16, 2022 11:08
KernelAwareTest
<?php
require_once dirname(__DIR__).'/../../../../app/AppKernel.php';
/**
* Test case class helpful with Entity tests requiring the database interaction.
* For regular entity tests it's better to extend standard \PHPUnit_Framework_TestCase instead.
*/
abstract class KernelAwareTest extends \PHPUnit_Framework_TestCase
{
@jakzal
jakzal / BehatTest.php
Created October 19, 2011 14:47
Running Behat in PHPUnit to calculate code coverage
<?php
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Behat\BehatBundle\Command\BehatCommand;
class BehatTest extends KernelAwareTest
{
/**
@stof
stof / User.php
Created May 26, 2011 22:45
Using custom constraints
<?php
namespace Acme\DemoBundle\Entity;
use Symfony\Component\Security\Core\User\UserInterface;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* @ORM\Entity