Skip to content

Instantly share code, notes, and snippets.

View diogodilcl's full-sized avatar
🎯
Focusing

Diogo Dil diogodilcl

🎯
Focusing
View GitHub Profile

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.
@sdpatil
sdpatil / Consumer.java
Last active July 4, 2023 17:47
Sample Kafka Consumer that receives JSON messages
package com.mapr.kafka.serializer.json;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.apache.kafka.common.errors.WakeupException;
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 24, 2024 06:43
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@dhrrgn
dhrrgn / core.py
Last active March 2, 2022 04:16
Tired of doing db.session.add and db.session.commit to save your records? Have no fear, save is here. Note: This is for use with Flask-SQLAlchemy
from .user import User
def init_db(db):
"""Add a save() function to db.Model"""
def save(model):
db.session.add(model)
db.session.commit()
db.Model.save = save