Skip to content

Instantly share code, notes, and snippets.

View cwhite92's full-sized avatar
👋

Chris White cwhite92

👋
View GitHub Profile
// I can achieve a background image with a semi-transparent overlay by using multiple CSS backgrounds...
.cover {
background: linear-gradient(rgba(255, 0, 0, 0.45), rgba(255, 0, 0, 0.45)), url(image.jpg);
}
// This works fine, but I'm specifying what image to use on my covers like this:
<div class="cover" style="background-image: url('<?php the_field('homepage_cover_image'); ?>');">
public function filterWorkRequests()
{
if ($this->workIsInappropriate()) {
return $this->absolutelyNot();
}
if ($this->workIsNeutral()) {
return $this->possibly();
}
[supervisord]
nodaemon=true
[program:php5-fpm]
command=/usr/sbin/php5-fpm --nodaemonize
[program:nginx]
command=/usr/sbin/nginx -g "daemon off;"
FROM ubuntu:14.04
MAINTAINER "Chris White" <chris@cwhite.me>
# Use bash instead of sh
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# Install required packages
RUN apt-get update
RUN apt-get install -y curl git nginx php5-cli php5-fpm php5-mysql php5-mcrypt php5-curl php5-gd supervisor
RUN php5enmod mcrypt
@cwhite92
cwhite92 / gist:859cf3fc53bb8fce3bad
Created December 24, 2015 21:40
Fractal transformer
<?php
namespace Lykit\Transformers;
use League\Fractal\TransformerAbstract;
use Lykit\Models\User;
use Tymon\JWTAuth\Facades\JWTAuth;
class UserTransformer extends TransformerAbstract
{
@cwhite92
cwhite92 / Code (100 bytes!!)
Last active December 1, 2015 13:58
AOC Day 1 Golf (credit to jamosaur, phroggyy and mamorunl, thomasruize)
<?php $f=$b=0;foreach(str_split(file('i')[0])as$p=>$d)($f-=$d=='('?-1:1)>=0|$b?:$b=$p+1;echo"$f $b";
@cwhite92
cwhite92 / Minified
Created November 19, 2015 12:17
PHP golf
<?php $b=99;$d=" bottles of beer";$c="$d on the wall";$f="file";do{echo "$b$c, $b$d.\n";if(!--$b){echo $f('http://is.gd/sKW90b')[0];$b=99;}else echo $f('http://is.gd/2m5PYo')[0];echo ", $b$c.\n\n";}while($b<99);
@cwhite92
cwhite92 / Minified
Created November 19, 2015 12:13
PHP 99 bottles golf
<?php $b=99;$d=" bottles of beer";$c=$d." on the wall";$f="file";do{echo $b.$c.", ".$b.$d.".\n";if(--$b==0){echo $f('http://is.gd/sKW90b')[0];$b=99;}else echo $f('http://is.gd/2m5PYo')[0];echo ", ".$b.$c.".\n\n";}while($b<99);
Take one down and pass it around
Go to the store and buy some more