Skip to content

Instantly share code, notes, and snippets.

View goatwu1993's full-sized avatar

Chao Yang Wu goatwu1993

View GitHub Profile
@themonster2015
themonster2015 / docker-compose.yml
Created May 3, 2019 14:51
BDE2020 Docker-compose.yml
version: "2"
services:
namenode:
build: ./namenode
image: bde2020/hadoop-namenode:1.1.0-hadoop2.7.1-java8
container_name: namenode
volumes:
- hadoop_namenode:/hadoop/dfs/name
environment:
@rluts
rluts / token_auth.py
Last active October 13, 2023 20:56
Token authorization middleware for Django Channels 2
from channels.auth import AuthMiddlewareStack
from rest_framework.authtoken.models import Token
from django.contrib.auth.models import AnonymousUser
from django.db import close_old_connections
class TokenAuthMiddleware:
"""
Token authorization middleware for Django Channels 2
"""
@mjj2000
mjj2000 / get-current-git-tag.sh
Last active June 4, 2024 14:55
[GIT] Get tag of current branch(that is HEAD) or fallback to short commit hash(7 digits) by single shell command
git describe --exact-match --tags 2> /dev/null || git rev-parse --short HEAD
@jarrad
jarrad / install-kafka.txt
Last active May 8, 2024 11:38
Install Kafka on OSX via Homebrew
$> brew cask install java
$> brew install kafka
$> vim ~/bin/kafka
# ~/bin/kafka
#!/bin/bash
zkServer start
kafka-server-start.sh /usr/local/etc/kafka/server.properties