Skip to content

Instantly share code, notes, and snippets.

Michael Ahlers michaelahlers

Block or report user

Report or block michaelahlers

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View concatenate-movies.sh
#!/bin/bash
$IN_FILE="*mp4"
$OUT_FILE="my-movie.mp4"
ffmpeg -safe 0 \
-f concat -i <(ls "$IN_FILE" | while read file; do echo file \'$PWD/$file\'; done) \
-c copy "$OUT_FILE"
@michaelahlers
michaelahlers / glacier-bulk-restore.sh
Last active Apr 4, 2019
Bulk restore-request of objects in S3.
View glacier-bulk-restore.sh
#!/bin/bash
BUCKET_NAME="my-bucket"
KEY_PREFIX="my-key-prefix"
DAYS = "10"
aws s3 ls --recursive "s3://$BUCKET_NAME/$KEY_PREFIX" |\
awk '{$1=$2=$3=""; print $0}' |\
sed 's/^[[:space:]]*//g' |\
tr '\n' '\0' |\
@michaelahlers
michaelahlers / EntityReferenceSpec.scala
Last active Nov 13, 2018
Illustrates why inheritance produces unexpected behavior when an entity may also service as a reference.
View EntityReferenceSpec.scala
import org.scalamock.scalatest._
import org.scalatest._
import scala.language.implicitConversions
class EntityReferenceSpec extends WordSpec with MockFactory {
"An entity" that {
"is also a reference" when {
@michaelahlers
michaelahlers / Embedded.scala
Last active May 4, 2018
Neo4j Impermanent Database with Bolt Connector
View Embedded.scala
import org.neo4j.driver.v1._
import org.neo4j.graphdb.factory.GraphDatabaseSettings
import org.neo4j.helpers.ListenSocketAddress._
import org.neo4j.kernel.configuration.BoltConnector.EncryptionLevel._
import org.neo4j.kernel.configuration.Connector.ConnectorType._
import org.neo4j.kernel.configuration.Settings.{ FALSE, TRUE }
import org.neo4j.kernel.configuration._
import org.neo4j.test._
import org.scalatest._
@michaelahlers
michaelahlers / idea.vmoptions
Last active Apr 21, 2017
Helpful IntelliJ IDEA settings for coping with egregiously-large SBT projects.
View idea.vmoptions
# See https://intellij-support.jetbrains.com/hc/en-us/articles/206544859-Mac-OS-specific-configuration-of-the-JVM-options for detials.
-server
-Xms2g
-Xmx2g
-XX:NewRatio=3
-Xss16m
-XX:+UseConcMarkSweepGC
-XX:+CMSParallelRemarkEnabled
-XX:ConcGCThreads=4
View keybase.md

Keybase

I hereby claim:

  • I am michaelahlers on github.
  • I am michaelahlers (https://keybase.io/michaelahlers) on keybase.
  • I have a public key ASDxnGn9BcucjilpJv6GW8GVTmYa1Tb7dPtHwA6fsGymMwo

Proof

@michaelahlers
michaelahlers / fight.md
Last active Apr 2, 2019
Pyramid Generator Challenge!
View fight.md
View lenses.sc
import scalaz.PLens._
import scalaz.Lens._
import scalaz._
case class Name(given: Option[String] = None, family: Option[String] = None)
val givenL: Name @> Option[String] = lensg(a => v => a.copy(given = v), _.given)
val familyL: Name @> Option[String] = lensg(a => v => a.copy(family = v), _.family)
case class Contact(name: Option[Name] = None)
You can’t perform that action at this time.