Skip to content

Instantly share code, notes, and snippets.

View manchicken's full-sized avatar
🦀
I pinch.

Mike Stemle manchicken

🦀
I pinch.
View GitHub Profile
@manchicken
manchicken / cpanfile
Last active October 1, 2020 01:28
A quick cpanfile so I don't have to remember dependencies anymore
requires 'Module::CAPIMaker' => '0';
requires 'Math::Int64' => '0';
@manchicken
manchicken / smtp-to-sns-json.pl
Last active September 29, 2020 15:31
This is a quick-and-dirty script I put together to help me convert SMTP messages to JSON similar to what I would get in a Lambda. The reason I wanted this was because I have some files from S3 in buckets which were forwarded via a Lambda, but they're not in the format that SNS sends to the Lambda. I want to add extra processing to the Lambda bas…
#!/usr/bin/env perl
use Modern::Perl '2020';
use Carp qw/croak/;
use JSON;
use Email::MIME;
use IO::File;
sub get_smtp {

Keybase proof

I hereby claim:

  • I am manchicken on github.
  • I am stemlem (https://keybase.io/stemlem) on keybase.
  • I have a public key ASCrcoQd82uvEOqt2ZjzexgX3ck1PYtWenAroVkPH1UMRQo

To claim this, I am signing this object:

✔ ~/Devel/perl6-posix-1 [refactoring|✚ 3]
22:45 $ perl6 --ll-exception -Ilib t/02-getuid.t
Could not find symbol '&DEFAULT'
at SETTING::src/core/Exception.pm:57 (/usr/local/Cellar/rakudo-star/2017.10/share/perl6/runtime/CORE.setting.moarvm:throw)
from SETTING::src/core/Failure.pm:44 (/usr/local/Cellar/rakudo-star/2017.10/share/perl6/runtime/CORE.setting.moarvm:throw)
from SETTING::src/core/Failure.pm:106 (/usr/local/Cellar/rakudo-star/2017.10/share/perl6/runtime/CORE.setting.moarvm:CALL-ME)
from gen/moar/BOOTSTRAP.nqp:3002 (/usr/local/Cellar/rakudo-star/2017.10/share/nqp/lib/Perl6/BOOTSTRAP.moarvm:)
from /Users/manchicken/Devel/perl6-posix-1/lib/POSIX.pm (POSIX):9 (/Users/manchicken/Devel/perl6-posix-1/lib/.precomp/272B80FC0A239CB25AC22453FE7B3B3434A80F34.1512853927.34594/23/23507E798D66FEE0B05313C2A15E15FF93E82F20:EXPORT)
from src/Perl6/World.nqp:880 (/usr/local/Cellar/rakudo-star/2017.10/share/nqp/lib/Perl6/World.moarvm:)
from src/Perl6/World.nqp:848 (/usr/local/Cellar/rakudo-star/2017.10/sh
@manchicken
manchicken / index.html
Created December 29, 2016 19:15
Inspecting Browser-Supplied MIME-Types
<form method="post" enctype="multipart/form-data" id="form" onSubmit="return runIt();">
<label for="fileInput">Select a File</label>
<input multiple="true" type="file" id="fileInput" name="fileInput" />
<input type="submit" name="submit" value="Check!" />
</form>
@manchicken
manchicken / rest-server-for-tests.js
Last active November 7, 2016 14:53
This is a simple HTTP server which gives you predictable HTTP responses based on the URL. It's super simple. This requires `lodash`.
'use strict'
const http = require('http')
const _ = require('lodash')
// Create an HTTP tunneling proxy
var svr = http.createServer( (req, res) => {
// Just some simple handler routines
const handlers = _.merge(
@manchicken
manchicken / simple-find-of-images.sh
Last active June 3, 2016 15:11
Simple command to find all of the images in a large directory tree
find ./public -type f | grep --line-buffered -i -E '\.(jpg|jpeg|bmp|gif|png)' | grep -v dojo
# OR
find -E ./public -type f -iregex '.*\.(jpg|jpeg|bmp|gif|png)' | grep -v dojo
# Compare the results of the two commands using MD5 sums:
find -E ./public -type f -iregex '.*\.(jpg|jpeg|bmp|gif|png)' | grep -v dojo | md5
# 65cc4b9df9eb6f99ecce0b5b1d209ecc
grep -aroP '.{0,20}XXXXX.{0,20}' {*.log,*.log-????????}
@manchicken
manchicken / Results.txt
Last active October 20, 2015 14:16
Inspired by https://gist.github.com/loganlinn/2165297, I want to see just `strtolower()` in an if though, and I wanted to see the results for larger values of `n`
mstemle@mstemle901:~/Desktop$ ./runtests.sh
String length: 512
************************
* if + strtolower *
************************
Time: 0.001159
Memory: 1904
************************
* strcasecmp *
************************