Skip to content

Instantly share code, notes, and snippets.

@evnm
evnm / spongebob
Created November 16, 2023 22:22
A shell command which prints its input wItH AlTeRnAtInG LoWeR AnD UpPeRcAsInG.
#! /bin/sh
# A shell command which prints its input wItH AlTeRnAtInG LoWeR AnD
# UpPeRcAsInG.
#
# Example:
# $ echo "we're all trying to find who did this" | spongebob
# wE'Re aLl tRyInG To fInD WhO DiD ThIs
<&0 awk '
{
@evnm
evnm / indievc_webinar1.md
Last active July 20, 2017 19:58
indie.vc webinar: Bootstrapping—Lead Generation and Script Writing

Presenter: Nima Elyassi-Rad

Blog post

Notes

  • Lead-gen flow: Prospect -> Lead -> Sales Qualified Lead (SQL) -> Customer
  • Research:
    • Why are you in business?
    • Exactly who are you helping?
    • What specifically are you doing for them?
@evnm
evnm / datadog-iam-stack.yml
Last active July 5, 2022 19:50
A CloudFormation template describing an IAM policy+role pair which grants cross-account read access for monitoring AWS infrastructure in Datadog
---
AWSTemplateFormatVersion: "2010-09-09"
Description: Creates a stack containing an IAM role used to grant
Datadog monitoring access to AWS infrastructures. See
http://docs.datadoghq.com/integrations/aws/#installation for
details.
Parameters:
DatadogAwsAccountId:
@evnm
evnm / README.md
Created November 11, 2015 21:19
README for a hypothetical stream-consumption command-line tool

scat

A stream consumption tool.

Status: Vaporware

Why?

In 2015, stream-processing is the it-girl of software architecture. This sub-field is driven forward by a growing number of

@evnm
evnm / gist:d17336bf42e887c6e756
Created June 10, 2015 23:39
Script to convert milliseconds since epoch to a human-readable timestamp
#!/usr/bin/python
import datetime
import sys
print datetime.datetime.fromtimestamp(float(sys.argv[1])/1000).strftime('%Y-%m-%d %H:%M:%S.%f')
@evnm
evnm / gist:31e4c5e4d37fb477b15c
Created March 10, 2015 20:38
A little script to generate new Scala+Maven projects
#! /bin/sh
#
# A little script to generate new Scala+Maven projects.
set -e
if test $# -lt 1; then
echo "usage: $0 <project name>"
exit 1
fi
@evnm
evnm / netty-ffc.md
Last active May 15, 2017 04:10
Preparatory notes for a Finagle Fight Club session on Netty.

Why is Netty necessary?

Deficiencies of raw NIO:

  • complicated APIs
  • Too low-level to be productive for application development.

whiteboard example of Buffer.flip

java.nio.Buffer:

@evnm
evnm / gcb
Last active December 29, 2015 07:09
A fuzzy `git checkout`.
#! /bin/sh
# A fuzzy `git checkout`.
match=`git rev-parse --abbrev-ref --branches="*$1*"`
case `wc -w <<< "$match" | tr -d ' '` in
"0") echo "error: '$1' did not match any branch." 2>&1 ;;
"1") git checkout $match ;;
*) echo "error: '$1' is ambigious among:\n$match" 2>&1
esac
@evnm
evnm / test_changed
Last active December 28, 2015 11:19
A Ruby script that runs tests with Pants for all projects that have been modified in the current working tree.
#!/usr/bin/env ruby
#
# Run tests for all projects that have been modified in the Birdcage,
# relative to HEAD.
#
# For example, if you've edited files in three projects, this script will
# run tests serially for these three projects in one command.
print "Determining which files have been changed..."
$stdout.flush
@evnm
evnm / FuturePool'd
Last active August 8, 2018 05:15
Comparing approaches to convert `java.util.concurrent.Future`s to `com.twitter.util.Future`s.
import com.twitter.util.{Future => TwitterFuture, FuturePool}
import java.util.concurrent.{Future => JavaFuture}
/**
* Convert a Java Future to a Twitter Future.
*/
def javaFutureToTwitterFuture[A](javaFuture: JavaFuture[A]): TwitterFuture[A] =
FuturePool.unboundedPool { javaFuture.get }