Skip to content

Instantly share code, notes, and snippets.

View ramsey's full-sized avatar

Ben Ramsey ramsey

View GitHub Profile
@ramsey
ramsey / php-8.1.0.alpha1.manifest
Created June 10, 2021 15:14
PHP 8.1.0 Alpha 1 Manifest
php-8.1.0alpha1.tar.bz2
SHA256 hash:
38fb766220c4e18da24db404812d343d34bb16256e621c629aafa7395b5e72f6
PGP signature:
- -----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEE8faSI4+8FmblpczUGZ+d/vb/uv0FAmC/m44ACgkQGZ+d/vb/
uv0SSxAAteA2Yy690Y1bp+TrsZ/zLKOxLb043zfsJp+Y5YyT2Gj3b9Esuvrh10JN
kqLM2ZEg2jpjCIhknimhOsgqiO2SikqkeHI3h4zo5BReOwpjHeaTv2ty6cH+EgPl
vA37pUXRIpcPlCDPxoNqEHlbsAD2paZB35HcrH57dYoRBUVGPbApwVxCVmNX+It+
@ramsey
ramsey / fn.slugify.sql
Created May 26, 2021 22:09 — forked from wesleymacente/fn.slugify.sql
slugify function for MySQL
/*
The MIT License (MIT)
Copyright (c) 2014 jose reis<jose.reis@artbit.pt>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@ramsey
ramsey / Dockerfile
Last active September 28, 2020 22:52
benramsey/pandoc-latex
FROM pandoc/latex:latest
RUN apk --no-cache add \
python3 \
python3-dev \
py3-psutil \
&& pip3 install --upgrade pip
RUN pip3 install \
pandocfilters \
@ramsey
ramsey / app.php
Created August 11, 2020 21:43
Simple example showing how multi-line responses work with symfony/console.
<?php
declare(strict_types=1);
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\Question;

Place theme files in ~/.k9s/ and create a symlink to the theme you wish to use as the current skin:

ln -s ~/.k9s/theme-to-use.yml ~/.k9s/skin.yml
@ramsey
ramsey / openapi.yaml
Last active September 26, 2019 17:57
OpenDISCO OpenAPI Document WIP
openapi: 3.0.2
info:
title: DISCO Server
contact:
url: http://www.open-disco.org
version: 'v1.0.0'
servers:
- url: http://rwmbook-registry.herokuapp.com
@ramsey
ramsey / r53export.sh
Last active October 19, 2023 17:46
Queries AWS Route53 for a zone name and outputs a zone file of its records
#!/bin/bash
#
# Queries AWS Route53 for a zone name and outputs a zone file of its records
#
# Usage:
#
# r53export example.com[ profile]
#
# By default, uses $AWS_PROFILE environment variable, if set.
#
@ramsey
ramsey / foo.php
Created October 16, 2017 21:11
Segfault when running built-in PHP web server
<?php
class Foo
{
public function execute($log)
{
file_put_contents($log, "this is a log\n", FILE_APPEND);
}
}
(new Foo())->execute('./mylog.txt');
@ramsey
ramsey / authenticate.php
Last active September 28, 2017 06:14
Demonstrate that Apache converts any response containing WWW-Authenticate to 401
<?php
header('HTTP/1.1 403 Forbidden');
if (isset($_GET['authHeader']) && $_GET['authHeader'] == 1) {
header('WWW-Authenticate: Bearer realm="Foo"');
}
echo "Hi!";
@ramsey
ramsey / cycle-list.php
Created September 1, 2017 13:31 — forked from chartjes/cycle-list.php
My PHP script for creating a Twitter list where people cycle on and off it based on 30 days of interaction
<?php
require "vendor/autoload.php";
use Abraham\TwitterOAuth\TwitterOAuth;
// You can get all these via https://dev.twitter.com/
$consumer_key = "";
$consumer_secret = "";
$access_token = "";
$access_token_secret = "";
$user_id = 0; // Twitter user ID