Skip to content

Instantly share code, notes, and snippets.

View Ilyes512's full-sized avatar
🔥

Ilyes512 Ilyes512

🔥
  • The Netherlands
View GitHub Profile
@Ilyes512
Ilyes512 / main.go
Created July 17, 2019 13:28 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@Ilyes512
Ilyes512 / Bar.php
Created October 3, 2018 20:24 — forked from ramsey/Bar.php
Mocking fluent interfaces with Mockery, and vary return values based on input to methods in the middle of the chain
<?php
namespace Ramsey\Talks;
class Bar
{
public function getSomething(Foo $foo, $arg1, $arg2)
{
$result = $foo->bar()->baz($arg1)->qux()->quux($arg2);
return "Now, we're {$result}";

Status

This extension was developed as part of the jsonapi module for Drupal.

Introduction

The JSON API specification is agnostic about how a server implements filtering strategies. In fact, the spec says:

Note: JSON API is agnostic about the strategies supported by a server. The filter query parameter can be used as the basis for any number of filtering strategies.

@Ilyes512
Ilyes512 / Flexible Dockerized Phoenix Deployments.md
Created February 21, 2018 08:45 — forked from jswny/Flexible Dockerized Phoenix Deployments.md
A guide to building and running zero-dependency Phoenix (Elixir) deployments with Docker. Works with Phoenix 1.2 and 1.3.

Prelude

I. Preface and Motivation

This guide was written because I don't particularly enjoy deploying Phoenix (or Elixir for that matter) applications. It's not easy. Primarily, I don't have a lot of money to spend on a nice, fancy VPS so compiling my Phoenix apps on my VPS often isn't an option. For that, we have Distillery releases. However, that requires me to either have a separate server for staging to use as a build server, or to keep a particular version of Erlang installed on my VPS, neither of which sound like great options to me and they all have the possibilities of version mismatches with ERTS. In addition to all this, theres a whole lot of configuration which needs to be done to setup a Phoenix app for deployment, and it's hard to remember.

For that reason, I wanted to use Docker so that all of my deployments would be automated and reproducable. In addition, Docker would allow me to have reproducable builds for my releases. I could build my releases on any machine that I wanted in a contai

@Ilyes512
Ilyes512 / ngxcb
Last active August 29, 2015 14:00
Nginx scripts for enable and disabling a site. This will create or destroy a symlink between a real config file in /etc/nginx/sites-available and a symlink in /etc/nginx/sites-enabled.
#!/usr/bin/env bash
# Show the usage for NGXCB
function show_usage {
cat <<EOF
NGXCB:
Create a new Nginx Server Block (Ubuntu Server).
Assumes /etc/nginx/sites-available and /etc/nginx/sites-enabled setup used.
@Ilyes512
Ilyes512 / nginx_laravel
Created April 4, 2014 22:41
Nginx Laravel Configuration
server {
listen 80;
server_name [www.laravel.dev];
# This will redirect users from "www.laravel.dev" to "laravel.dev"
return 301 $scheme://[laravel.dev]$request_uri;
}
server {
listen 80;
@Ilyes512
Ilyes512 / nvm_install.sh
Last active January 1, 2017 03:30
A custom NVM install.sh script for Vaprobash
#!/usr/bin/env bash
NVM_DIR="/home/vagrant/.nvm"
if ! hash git 2>/dev/null; then
echo >&2 "!!! You need to install git"
exit 1
fi
if [ -d "$NVM_DIR" ]; then
@Ilyes512
Ilyes512 / Vagrantfile
Last active December 28, 2015 06:38
Vagrant for the sole purpose of creating Jekyll (GutHub) pages
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# Box name & download source
config.vm.box = "ubuntu-precise12042-x64-vbox43"
config.vm.box_url = "https://puphpet.s3.amazonaws.com/ubuntu-precise12042-x64-vbox43.box"
# Network