I hereby claim:
- I am carestad on github.
- I am karlstad (https://keybase.io/karlstad) on keybase.
- I have a public key ASBdjb4nFyklP4MvxzxDntz8_HIN-VFz1SKRfFHtBqUJbAo
To claim this, I am signing this object:
[client] | |
character-set-server = utf8 | |
[mysqld] | |
character-set-server = utf8 | |
collation-server = utf8_unicode_ci | |
character-sets-dir = /usr/share/mysql/charsets | |
#default-character-set = utf8 | |
init-connect = 'SET NAMES utf8' |
<?php | |
/** | |
* Add a filter to stylesheet_uri, which appends a query string to it automagically. | |
*/ | |
add_filter('stylesheet_uri', function($css) { | |
$parts = parse_url($css); | |
$file = $_SERVER['DOCUMENT_ROOT'] . $parts['path']; |
#!/bin/bash | |
# | |
# By: Alexander Karlstad <alexanderkarlstad@gmail.com> | |
# | |
# Requires 'jq' and 'curl' | |
# | |
# To install (on Ubuntu): | |
# sudo apt install jq curl | |
function halp() { |
#!/bin/bash | |
function _jottacli() { | |
local config_params cmds cur first params prev second | |
COMPREPLY=() | |
cur=${COMP_WORDS[COMP_CWORD]} | |
first=${COMP_WORDS[1]} | |
second=${COMP_WORDS[2]} | |
prev=${COMP_WORDS[COMP_CWORD-1]} |
<?php | |
$file = '/foo/bar/document.pdf'; | |
$im = new \Imagick($file); | |
$im->setIteratorIndex(0); // just use first page | |
$im->setImageAlphaChannel(\Imagick::VIRTUALPIXELMETHOD_WHITE); // Other alpha options are available, see Imagick PHP documentation | |
$im->setImageColorspace(\Imagick::COLORSPACE_SRGB); // Other colorspaces are available, see Imagick PHP documentation | |
$im->setImageBackgroundColor('white'); // Set transparent background elements to this color | |
$im->setFormat('JPG'); // Format, a wide variety is supported |
I hereby claim:
To claim this, I am signing this object:
#!/bin/bash | |
# | |
# Author: Alexander Karlstad <carestad@github> | |
# Updated: 2019-07-17 | |
# Configurable variables | |
slack_channel="@alexander" | |
slack_icon=":information_source:" | |
slack_user="apt@$(hostname -f)" | |
slack_webhook="" |
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
use Illuminate\Http\UploadedFile; | |
class DataUriToFile | |
{ | |
/** |
<?php | |
namespace App\Http\Requests; | |
use Illuminate\Foundation\Http\FormRequest; | |
class FooRequest extends FormRequest | |
{ | |
public function authorize() | |
{ |
<?php | |
namespace Database\Migrations\Types; | |
use DateTime; | |
use Doctrine\DBAL\Platforms\AbstractPlatform; | |
use Doctrine\DBAL\Types\ConversionException; | |
use Doctrine\DBAL\Types\PhpDateTimeMappingType; | |
use Doctrine\DBAL\Types\Type; |