Skip to content

Instantly share code, notes, and snippets.

View gcphost's full-sized avatar

William gcphost

View GitHub Profile
'use strict';
/*jshint esversion: 6 */
const DEFAULT_LIMIT = 10;
const DEFAULT_OFFSET = 0;
const DEFAULT_PAGE = 1;
/**
* Exports a plugin to pass into the bookshelf instance, i.e.:
@gcphost
gcphost / remove-local-repos.php
Created February 16, 2017 17:32
Hack to replace repositories in composer.json
<?php
/*
|--------------------------------------------------------------------------
| Remove Local Repositories
|--------------------------------------------------------------------------
|
| This script will remove local repositories from the composer.json and
| replace them with the github version.
|
@gcphost
gcphost / .gitlab-ci
Created September 12, 2016 16:08
.gitlab-ci
dockerandtest:
script:
- pwd
- git describe --tags > version.txt
- docker-pull lucacri/laravelcaddy
- docker-compose kill || true
- docker-compose rm -f || true
- docker-compose -f docker-compose-gitlab.yml kill || true
- docker-compose -f docker-compose-gitlab.yml rm -f || true
- docker-compose -f docker-compose-gitlab.yml pull
@gcphost
gcphost / rancher-compose.yaml
Created September 12, 2016 16:05
rancher-compose.yaml
web:
scale: 4
upgrade_strategy:
start_first: true
health_check:
port: 80
interval: 30000
unhealthy_threshold: 4
response_timeout: 20000
request_line: GET / HTTP/1.0
@gcphost
gcphost / docker-compose.yaml
Created September 12, 2016 16:04
docker-compose.yaml
postgres:
image: 'postgres:latest'
environment:
- POSTGRES_USER=blog
- POSTGRES_PASSWORD=blog123
redis:
restart: always
labels:
io.rancher.scheduler.affinity:host_label: rediscluster=true
@gcphost
gcphost / docker-compose.yaml
Created September 12, 2016 16:02
Docker, Rancher, and Laravel: Easy and Safe Scalability! docker-compose.yaml
postgres:
image: 'postgres:latest'
environment:
- POSTGRES_USER=blog
- POSTGRES_PASSWORD=blog123
redis:
restart: always
labels:
io.rancher.scheduler.affinity:host_label: rediscluster=true
@gcphost
gcphost / Dockerfile
Created September 12, 2016 16:00
Docker, Rancher, and Laravel: Easy and Safe Scalability! Dockerfile
FROM ubuntu
RUN apt-get update
RUN apt-get install -y php
RUN mkdir -p /var/www
EXPOSE 8999
ENTRYPOINT php -S 0.0.0.0:8999 -t /var/www
@gcphost
gcphost / index.html
Last active September 6, 2016 16:36
Material design styled inputs with placeholders.
<div class="form-input">
<label>
<input required>
<span class="placeholder">Text Input</span>
</label>
</div>
<div class="form-input">
<label>
<textarea rows="10" required></textarea>
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterUsersTableAddMultipleIndex extends Migration
{
/**
* Run the migrations.
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterUsersTableAddUsernameIndex extends Migration
{
/**
* Run the migrations.