Skip to content

Instantly share code, notes, and snippets.

View chasen's full-sized avatar

Chase Noel chasen

View GitHub Profile
@hermanbanken
hermanbanken / Dockerfile
Last active April 22, 2024 10:53
Compiling NGINX module as dynamic module for use in docker
FROM nginx:alpine AS builder
# nginx:alpine contains NGINX_VERSION environment variable, like so:
# ENV NGINX_VERSION 1.15.0
# Our NCHAN version
ENV NCHAN_VERSION 1.1.15
# Download sources
RUN wget "http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" -O nginx.tar.gz && \
@alexstone
alexstone / slack_notification.php
Created March 3, 2014 06:54
Fire a Slack Notification via CURL
<?php
// (string) $message - message to be passed to Slack
// (string) $room - room in which to write the message, too
// (string) $icon - You can set up custom emoji icons to use with each message
public static function slack($message, $room = "engineering", $icon = ":longbox:") {
$room = ($room) ? $room : "engineering";
$data = "payload=" . json_encode(array(
"channel" => "#{$room}",
"text" => $message,
@justjkk
justjkk / camel2Title.php
Created November 28, 2011 21:06
CamelCase to Title Case PHP Regex
<?php
function camelToTitle($camelStr)
{
$intermediate = preg_replace('/(?!^)([[:upper:]][[:lower:]]+)/',
' $0',
$camelStr);
$titleStr = preg_replace('/(?!^)([[:lower:]])([[:upper:]])/',
'$1 $2',
$intermediate);