Skip to content

Instantly share code, notes, and snippets.

@jopecko
jopecko / showProcessedCount.scala
Last active July 27, 2022 18:05 — forked from kubukoz/showProcessedCount.scala
Periodically show the amount of elements produced by an fs2 stream
def showProcessedCount[F[_]: Concurrent: Timer, A]: Pipe[F, A, A] = stream =>
fs2.Stream.eval(Ref[F].of(0)).flatMap { count =>
stream.chunks
.evalMap { chunk =>
count.update(_ + chunk.size).as(chunk)
}
.flatMap(fs2.Stream.chunk)
.concurrently(
fs2.Stream
import shapeless._
import scalaz._
import Scalaz._
object console extends App {
trait Foo[A] {
type B
def value: B
@jopecko
jopecko / postgres_queries_and_commands.sql
Created June 21, 2021 19:04 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@jopecko
jopecko / latency.txt
Created October 21, 2020 19:50 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD

Haskeller Competency Matrix

See also List of materials about Software Design in Haskell

Junior Middle Senior Architect
Haskell level Basic Haskell Intermediate Haskell Advanced Haskell Language-agnostic
Haskell knowledge scope Learn you a Haskell Get programming with Haskell Haskell in Depth Knows several languages from different categories
Get programming with Haskell Haskell in Depth Functional Design and Architecture
[Other books on Software Architecture in Haskell](https://github.com/graninas/software-design-in-haskell#Books-on-S
@jopecko
jopecko / flask-boilerplate-tmux.bash
Created January 8, 2019 16:27 — forked from swaroopch/flask-boilerplate-tmux.bash
A command that scripts a tmux session
#!/bin/bash
function flask-boilerplate-tmux
{
# https://github.com/swaroopch/flask-boilerplate
BASE="$HOME/code/flask-boilerplate"
cd $BASE
tmux start-server
tmux new-session -d -s flaskboilerplate -n model
@jopecko
jopecko / generate_aws_ssh_config.py
Last active February 28, 2018 00:26
AWS SSH config generation
#!/usr/bin/env python
import boto.ec2
import os
def main():
defaultUser = 'jopecko'
userHome = os.getenv('USERPROFILE') or os.getenv('HOME')
defaultKeyPath = os.path.join(userHome, '.ssh')
for region in boto.ec2.regions():

Keybase proof

I hereby claim:

  • I am jopecko on github.
  • I am jopecko (https://keybase.io/jopecko) on keybase.
  • I have a public key ASB1P1hnBFp-eJxKW1iUU-Q3MtMFDHspxB29lR3kZMnHEAo

To claim this, I am signing this object:

A lot of these are outright stolen from Edward O'Campo-Gooding's list of questions. I really like his list.

I'm having some trouble paring this down to a manageable list of questions -- I realistically want to know all of these things before starting to work at a company, but it's a lot to ask all at once. My current game plan is to pick 6 before an interview and ask those.

I'd love comments and suggestions about any of these.

I've found questions like "do you have smart people? Can I learn a lot at your company?" to be basically totally useless -- everybody will say "yeah, definitely!" and it's hard to learn anything from them. So I'm trying to make all of these questions pretty concrete -- if a team doesn't have an issue tracker, they don't have an issue tracker.

I'm also mostly not asking about principles, but the way things are -- not "do you think code review is important?", but "Does all code get reviewed?".

@jopecko
jopecko / gist:2426315
Created April 20, 2012 05:32 — forked from Gregg/gist:968534
Code School Screencasting Framework

Screencasting Framework

The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.

Why you should care about screencasting?

You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.

  1. Communicating more effectively - At Envy Labs we produce screencasts for our clients all the time. Whether it's demoing a new feature or for a presentation for an invester, they're often much more effective and pleasent than a phone call or screen sharing.