Skip to content

Instantly share code, notes, and snippets.

@cviebrock
cviebrock / dovecot-maildir-compress.sh
Last active November 26, 2022 16:21 — forked from cs278/dovecot-maildir-compress.sh
Compresses email in maildir format
#!/bin/sh
# Find the mails you want to compress in a single maildir.
#
# Skip files that don't have ,S=<size> in the filename.
#
# Compress the mails to tmp/
#
# Update the compressed files' mtimes to be the same as they were in the original files (e.g. touch command)
#
@cviebrock
cviebrock / ElasticLoggingProvider.php
Created September 29, 2016 14:57
Log Laravel to Elastic/Logstash
<?php namespace App\Providers;
use Elastica\Client;
use Illuminate\Support\ServiceProvider;
use Monolog\Formatter\LogstashFormatter;
use Monolog\Handler\ElasticSearchHandler;
class ElasticLoggingProvider extends ServiceProvider
{
@cviebrock
cviebrock / rating.php
Created September 21, 2016 02:24
Quick script to calculate the change in Scrabble rating between yourself and a field of opponents
<?php
if ($argc < 3) {
echo <<< EOB
USAGE: {$argv[0]} myRating opp1rating [opp2rating...]
EOB;
exit(1);
}
@cviebrock
cviebrock / keybase.md
Created January 18, 2016 19:11
keybase.md

Keybase proof

I hereby claim:

  • I am cviebrock on github.
  • I am cviebrock (https://keybase.io/cviebrock) on keybase.
  • I have a public key whose fingerprint is 5099 35DF 565A 490D E8B4 C4B9 B5CD D17A 2B4A 066B

To claim this, I am signing this object:

@cviebrock
cviebrock / ListOfValidator.php
Created November 30, 2015 21:38
Validate a list of things
<?php
namespace App\Validators;
use Illuminate\Contracts\Validation\Validator;
class ListOfValidator
{
public function validate($attribute, $value, $parameters, Validator $validator)
@cviebrock
cviebrock / wez.itermcolors
Last active September 6, 2015 22:20 — forked from wez/wez.itermcolors
Wez's iTerm 2 Colour selection
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<key>Green Component</key>
<real>0.0</real>
@cviebrock
cviebrock / laracon-slides.md
Last active September 1, 2016 22:32
Just a collection of links to all the slide decks used at Laracon 2015 in Louisville, KY.
@cviebrock
cviebrock / cviebrock.zsh-theme
Last active May 2, 2017 21:18
my zsh theme
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
#
$data = $YOUR_QR_STUFF->getImage();
ob_start();
imagepng($data);
$image_data = ob_get_contents();
ob_end_clean();
store_stuff_in_redis($key, $data);
@cviebrock
cviebrock / select2-foundation5.css
Created December 20, 2013 15:56
Select2 CSS for Zurb Foundation 5
/*
Version: 3.4.5 Timestamp: Mon Nov 4 08:22:42 PST 2013
*/
.select2-container {
margin: 0 0 1rem 0;
position: relative;
vertical-align: middle;
font-family: inherit;
-webkit-appearance: none !important;
font-size: 0.875rem;