Skip to content

Instantly share code, notes, and snippets.

View nicholasruunu's full-sized avatar

Nicholas Ruunu nicholasruunu

View GitHub Profile
@nicholasruunu
nicholasruunu / NullFilter.php
Created February 21, 2017 15:19
Null filter for API-platform
<?php
namespace AppBundle\Api\Filter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\AbstractFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface;
use Doctrine\ORM\QueryBuilder;
/**
* NullFilter for api-platform
// Add arrows for extra navigation
$arrowContainer = $('<div class="arrow-container"/>')
.append($('<i class="fa fa-arrow-left"/>'))
.append($('<i class="fa fa-arrow-right"/>'));
var $arrowContainerClone = $arrowContainer.clone();
$imageContainer.append($arrowContainer);
$largePreviewImageContainer.append($arrowContainerClone);
$arrowContainer = $arrowContainer.add($arrowContainerClone);
/**
* @throws AdressApiDown
*/
public function validate($value, Constraint $constraint): void
{
try {
if ($someService->checkValue($value)) {
$this->context
->buildViolation($constraint->message)
->addViolation();
FROM frolvlad/alpine-python3
RUN apk add --update make gcc git python3-dev musl-dev libffi-dev openssl-dev py-pip
RUN pip install -r requirements.txt
COPY . /app
WORKDIR /app
ENTRYPOINT pytest config-test/ -s --env=
// Run with
// docker run <container> $TEST_ENV
Verifying that "nicholasruunu.id" is my Blockstack ID. https://onename.com/nicholasruunu
@nicholasruunu
nicholasruunu / FetchMembers.elm
Created October 13, 2016 13:49
Elm vs jQuery
module Main exposing (..)
import Html exposing (..)
import Html.App as App
import Html.Attributes exposing (..)
import Json.Decode as Json exposing ((:=))
import Task
import Http
<?php
declare(strict_types=1);
abstract class EventFactory
{
public function apply()
}
<?php
namespace Purist\Message;
use InvalidArgumentException;
use Psr\Http\Message\MessageInterface;
use Psr\Http\Message\StreamInterface;
final class HttpMessage implements MessageInterface
{
<?php
final class MonthNumber
{
private $number;
public function __construct(int $number)
{
$this->number = $number;
}

Instructions

  • Install stud $ brew install https://raw.github.com/paulnicholson/homebrew/master/Library/Formula/stud.rb
  • Download and install the powssl script $ curl https://raw.github.com/gist/2050941/3ea59efe8c7e9013c265313045a9fdda5c653963/powssl > ~/bin/powssl $ chmod +x ~/bin/powssl
  • Run powssl to create development certificate and configure stud.
  • $ powssl