Skip to content

Instantly share code, notes, and snippets.

View jpfuentes2's full-sized avatar

Jacques Fuentes jpfuentes2

  • Chime
  • Richmond, VA
View GitHub Profile
@vkostyukov
vkostyukov / statuses.md
Last active February 13, 2024 21:39
HTTP status codes used by world-famous APIs
API Status Codes
[Twitter][tw] 200, 304, 400, 401, 403, 404, 406, 410, 420, 422, 429, 500, 502, 503, 504
[Stripe][stripe] 200, 400, 401, 402, 404, 429, 500, 502, 503, 504
[Github][gh] 200, 400, 422, 301, 302, 304, 307, 401, 403
[Pagerduty][pd] 200, 201, 204, 400, 401, 403, 404, 408, 500
[NewRelic Plugins][nr] 200, 400, 403, 404, 405, 413, 500, 502, 503, 503
[Etsy][etsy] 200, 201, 400, 403, 404, 500, 503
[Dropbox][db] 200, 400, 401, 403, 404, 405, 429, 503, 507
@djspiewak
djspiewak / 0introduction.md
Last active November 28, 2023 15:03
Scala Collections Proposal

Collections Redesign Proposal

I'm going to start off by motivating what I'm doing here. And I want to be clear that I'm not "dissing" the existing collections implementation or anything as unproductively negative as that. It was a really good experiment, it was a huge step forward given what we knew back in 2.8, but now it's time to learn from that experiment and do better. This proposal uses what I believe are the lessons we can learn about what worked, what didn't work, and what is and isn't important about collections in Scala.

This is going to start out sounding really negative and pervasively dismissive, but bear with me! There's a point to all my ranting. I want to be really clear about my motivations for the proposal being the way that it is.

Problems

Generic Interfaces

@cb372
cb372 / jargon.md
Last active May 8, 2023 16:03
Category theory jargon cheat sheet

Category theory jargon cheat sheet

A primer/refresher on the category theory concepts that most commonly crop up in conversations about Scala or FP. (Because it's embarassing when I forget this stuff!)

I'll be assuming Scalaz imports in code samples, and some of the code may be pseudo-Scala.

Functor

A functor is something that supports map.

@joehillen
joehillen / server.hs
Last active June 1, 2022 17:56
A re-implementation of Simon Marlow's Async Haskell Chat Server using Conduits
{-# LANGUAGE OverloadedStrings, RecordWildCards, LambdaCase #-}
import Conduit
import Data.Conduit
import Data.Conduit.Network
import qualified Data.ByteString.Char8 as BS
import Data.Conduit.TMChan
import Text.Printf (printf)
import Control.Concurrent.STM
import qualified Data.Map as Map
@davidkelley
davidkelley / .script.app
Last active June 15, 2016 16:34
Configures Vagrant to run Docker & Fig
# Run Application specific setup tasks here!
#!/usr/bin/env bash
cd /vagrant
fig run web foreman run rake db:create
fig run web foreman run rake db:migrate

Pushodoro

Pushodoro combines the Pomodoro Technique with a quick and simple calisthenics routine, starting with push-ups, to get your butt in shape.

We're killing ourselves

The awful truth: we sit on our butts toiling away at computers far too long -- and it's killing us. It makes us unhealthy, stupid, and we're 40% more likely to die within 15 years. The benefits from 30 minutes of rigorous exercise is completely erased if you sit for 6 hours.

Let's fix this problem

#!/usr/bin/env bash
#
# Wraps curl with a custom-drawn progress bar. Use it just like curl:
#
# $ curl-progress -O http://example.com/file.tar.gz
# $ curl-progress http://example.com/file.tar.gz > file.tar.gz
#
# All arguments to the program are passed directly to curl. Define your
# custom progress bar in the `print_progress` function.
#
@wofeiwo
wofeiwo / gist:3634357
Created September 5, 2012 10:00
Golang daemonize
/* ivan(a.t)mysqlab.net */
package main
import (
"syscall"
"os"
"log"
)
func daemon(nochdir, noclose int) int {
@shapeshed
shapeshed / nginx_rails_3_1
Created October 10, 2011 19:13
Nginx Config for Rails 3.1 with Unicorn and Asset Pipeline
upstream app {
server unix:/srv/app/current/tmp/sockets/unicorn.sock fail_timeout=0;
}
server {
listen 80;
server_name www.app.com;
rewrite ^/(.*) http://app.com/$1 permanent;
}
server {
@wadey
wadey / iterm2.zsh
Last active March 10, 2024 00:32
Change iTerm2 tab color when using SSH
# Usage:
# source iterm2.zsh
# iTerm2 tab color commands
# https://iterm2.com/documentation-escape-codes.html
if [[ -n "$ITERM_SESSION_ID" ]]; then
tab-color() {
echo -ne "\033]6;1;bg;red;brightness;$1\a"
echo -ne "\033]6;1;bg;green;brightness;$2\a"