Skip to content

Instantly share code, notes, and snippets.

View thomasbhatia's full-sized avatar

Thomas Bhatia thomasbhatia

View GitHub Profile
@juanje
juanje / podman_comands.sh
Created June 10, 2020 14:53
Run Redis with Podman. As a Systemd service and as a Pod.
# This is a simple example of how to run a basic service inside a container with Podman
# Podman
## Pull the Docker image
podman pull docker.io/redis
## Run the container as you would do with Docker
podman run -d --name redis_server -p 6379:6379 redis
# But Podman facilitate some extra ways:
@egeromin
egeromin / async-experiments.md
Created January 20, 2018 21:33
Asynchronous Programming and Microservices: Comparing Javascript, Erlang and Python with RabbitMQ + Celery

Asynchronous Programming and Microservices: Comparing Javascript, Erlang and Python with RabbitMQ + Celery

This article is about building asynchronous microservices. I'll compare how this can be achieved in Javascript and Erlang natively, and in Python using RabbitMQ and Celery.

But why?

My first encounter with asynchronous programming in python was when building a web backend. Upon completing a purchase, the user should eventually receive a PDF invoice by email. This didn't have to happen immediately during the request; in fact, it was better if it didn't, so as not to slow down the purchase needlessly. At the time I wasn't sure how to implement an asynchronous workflow in python, but a quick google search quickly lead me to Celery and RabbitMQ. Celery is very easy to use; the only pain is setting up a message broker -- RabbitMQ, in my case. Once you're set up, running a task in the background is as easy as writing, in myapp.py,

@bearfrieze
bearfrieze / comprehensions.md
Last active December 23, 2023 22:49
Comprehensions in Python the Jedi way

Comprehensions in Python the Jedi way

by Bjørn Friese

Beautiful is better than ugly. Explicit is better than implicit.

-- The Zen of Python

I frequently deal with collections of things in the programs I write. Collections of droids, jedis, planets, lightsabers, starfighters, etc. When programming in Python, these collections of things are usually represented as lists, sets and dictionaries. Oftentimes, what I want to do with collections is to transform them in various ways. Comprehensions is a powerful syntax for doing just that. I use them extensively, and it's one of the things that keep me coming back to Python. Let me show you a few examples of the incredible usefulness of comprehensions.

@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
@jaredmorrow
jaredmorrow / read_write_fifo_erlang.md
Last active April 22, 2023 20:05
Reading and Writing to Fifo (named pipes) in Erlang

edit

@akash-akya pointed out in the comments that the file module supports named pipes since OTP 20. So none of this post is really needed anymore if you are on >= OTP 21.


Erlang and Named Pipes

The intention of this post is to provide a solution (with examples) to a somewhat uncommon issue in Erlang. I hate searching for answers to the same problems over and over, and I had a hard time finding answers to this particular problem, so I wrote it all down once I figured it out. If one day you decide to read and write data through fifo's (named pipes) and then decide you want to read or write the other end of the pipe from Erlang, this post is for you.

@seriyps
seriyps / tcp_server.rs
Last active November 17, 2022 10:08
Simple concurrent TCP echo server (rust 0.11)
#![feature(phase)]
#[phase(plugin, link)] extern crate log;
extern crate green;
extern crate rustuv;
use std::io;
use std::os;
use std::io::{Listener,Acceptor,TcpStream};
#[start]

On the Viability of Erlang Releases and CouchDB

There has been some discussion on what versions of Erlang CouchDB should support, and what versions of Erlang are detrimental to use. Sadly there were some pretty substantial problems in the R15 line and even parts of R16 that are landmines for CouchDB. This post will describe the current state of things and make some potential recommendations on approach.

Scheduler Collapse

@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active June 28, 2024 10:38
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@jikamens
jikamens / encryption.py
Last active August 11, 2017 03:49
Python code for Schematics field encryption / decryption that is compatible with Ruby's mongoid-encrypted-fields + gibberish. The Encryptor object in this gist does encryption / decryption that is compatible with "openssl enc -k *password* -salt -aes-256-cbc". If you want it also to be compatible with mongoid-encrypted-fields, then you need to s…
import binascii
from Crypto.Cipher import AES
from Crypto.Random.random import getrandbits
from hashlib import md5
from schematics.types import StringType
import struct
class DecryptionException(Exception):
pass
@danielcosta
danielcosta / integrating_jira_with_sourcetree.md
Last active November 7, 2023 21:03
Learn how to integrate your SourceTree repositories with JIRA

Integrating JIRA with SourceTree

Overview

You will learn how to link your JIRA tasks directly on SourceTree

Step by step

1. Setting