Skip to content

Instantly share code, notes, and snippets.

View theevangelista's full-sized avatar
👽
Conquering the world

Evangelista theevangelista

👽
Conquering the world
View GitHub Profile
@ralt
ralt / eshell.org
Last active January 19, 2022 19:18
my eshell config

Eshell

eshell is the shell I’ve tried using over time, and in the end just never stick with it. Let’s try one more time with a couple of tricks. The first tricks are mostly documentation:

  • M-& in a tramp-aware session means you run commands in a new buffer, without a TTY. Great for things like tailf.
  • for ncurses-like applications, “visual commands” is the missing context. Applications like top are in the default list by default,
@montanaflynn
montanaflynn / context.go
Last active September 13, 2023 12:51
An example of using context to cancel goroutines between server handlers
package main
import (
"context"
"fmt"
"log"
"net/http"
"sync"
"time"
)
@theevangelista
theevangelista / gen_datatree.py
Created September 19, 2017 16:49
Generate a Tree for Train/Dev/Test with folders for each class
#!/usr/bin/env python
import os
import argparse
FOLDERS = ['train', 'dev', 'test']
parser = argparse.ArgumentParser(
description='Folder strcture generator for datasets')
parser.add_argument('classes', type=str,
@tomekowal
tomekowal / pure-impure.md
Last active August 12, 2020 10:05
Pure vs impure

Pure vs impure and why should I care?

Some of the most important advancements in programming came from adding restrictions to the way we program. Famous article by Edsger Dijkstra Go To Statement Considered Harmful shows how introducing one statement into programming language breaks many nice properties of that language. goto gives us freedom and solves couple of simple problems like breaking from nested loops easily, but it can make programs very hard to understand. This happens, because we cannot look at two pieces of code in spearation. The execution can jump to some other place in code or even worse: it can jump from other piece of code to here and We need to keep that in mind.

@Brainiarc7
Brainiarc7 / gnu-parallel-bioinformatics.md
Last active September 6, 2023 13:59
GNU Parallel usage in Bioinformatics with examples: A primer.
@mattbarackman
mattbarackman / Type_Families_Sealed_Traits_and_Exhaustive_Pattern_Matching_in_Scala.md
Last active August 25, 2020 01:08
A brief lesson on Type Families, Sealed Traits, and Exhaustive Pattern Matching in Scala

Scala: Type Families, Sealed Traits, and Exhaustive Pattern Matching

By: Matt Barackman

What is a Type Family?

A collection of objects or case classes that share a sealed trait.

In the example below, the type family would be a collection of traffic light colors with Red, Yellow, and Green as member objects.

@guidomedina
guidomedina / MpscBoundedMailbox.java
Last active November 5, 2018 19:27
MpscBoundedMailbox
import akka.actor.ActorRef;
import akka.dispatch.*;
import org.jctools.queues.MpscArrayQueue;
/**
* Non-blocking, multiple producer, single consumer high performance bounded message queue,
* this implementation is similar but simpler than LMAX disruptor.
*/
public final class MpscBoundedMailbox implements MessageQueue {
@kciesielski
kciesielski / freemonads.scala
Last active April 12, 2019 00:09
Free Monads example
package com.softwaremill.freemonads
import cats.free.Free
import cats.~>
import cats._, cats.std.all._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
sealed trait External[A]
case class Tickets(count: Int) extends AnyVal
@voxxit
voxxit / USING-VAULT.md
Last active July 7, 2022 03:02
Consul + Vault + MySQL = <3
git clone https://gist.github.com/dd6f95398c1bdc9f1038.git vault
cd vault
docker-compose up -d
export VAULT_ADDR=http://192.168.99.100:8200

Initializing a vault:

vault init
# zsh
EMOJI=(💩 🐦 🚀 🐞 🎨 🍕 🐭 👽 ☕️ 🔬 💀 🐷 🐼 🐶 🐸 🐧 🐳 🍔 🍣 🍻 🔮 💰 💎 💾 💜 🍪 🌞 🌍 🐌 🐓 🍄 )
function random_emoji {
echo -n "$EMOJI[$RANDOM%$#EMOJI+1]"
}
PROMPT="$(random_emoji) "
RPROMPT='%c'