Skip to content

Instantly share code, notes, and snippets.

View bzd111's full-sized avatar
💭
more input and more output

bzd111 bzd111

💭
more input and more output
View GitHub Profile
@mengwangk
mengwangk / init.vim
Last active November 29, 2023 12:44
Full Neovim init.vim
"---- vim-plug setup ----
let vimplug_exists=expand('~/.config/nvim/autoload/plug.vim')
if has('win32')&&!has('win64')
let curl_exists=expand('C:\Windows\Sysnative\curl.exe')
else
let curl_exists=expand('curl')
endif
if !filereadable(vimplug_exists)
if !executable(curl_exists)
# coding=utf-8
# pip install zhihu_oauth python-dateutil
import os
import re
from datetime import datetime
from collections import defaultdict
import dateutil.parser
from zhihu_oauth import ZhihuClient
@wushaobo
wushaobo / .block
Last active October 16, 2023 08:25
Flask server-side session with redis
license: gpl-3.0
border: no
@genomics-geek
genomics-geek / README.md
Last active January 10, 2024 15:27
Setting up a Dockerized web application with Django REST APIs, ReactJS with Redux pattern, and Webpack Hot Reloading! Mouthful.

Guide on how to create and set up a Dockerized web app using Django REST APIs and ReactJS

Hopefully this will answer "How do I setup or start a Django project using REST Framework and ReactJS?"

This is a guide to show you step by step how this can be setup. If you just want to get started, use the cookiecuter I set up cookiecutter-django-reactjs. It basically is a fork of pydanny's cookiecutter, just added the front-end stuff :).

I created this because it was SUCH a pain in the ass setting up a project using all the latest technologies. After some research, I figured it out and have it working. The repo that implements this is located here. Feel free to use it as a boilerplate ;)

Main features:

  • Django REST APIs
@dongweiming
dongweiming / cn_participation.py
Last active September 5, 2019 15:57
Get chinese contributor
# coding=utf-8
# Note:
# 1. 使用Redis缓存用户信息,减少重复调用
# 2. 只通过用户的location字段看是否包含beijing、shanghai、guangzhou、
# shenzhen、china这几个关键词判断是否是国人
from collections import defaultdict
import redis
import requests
USENAME = '<YOUR USERNSME>'
@lmyyao
lmyyao / connection_pool.py
Created August 1, 2016 01:44
Connection Pool Demo
# from .celery import app
import heapq
import socket
from collections import UserDict
from functools import singledispatch, update_wrapper
from operator import itemgetter
from select import poll, POLLIN
from urllib.parse import urlparse
import httplib2
@playpauseandstop
playpauseandstop / Makefile
Last active August 3, 2021 18:22
Setup aiohttp web app with Session Middleware to use Redis Storage and run under Gunicorn.
.PHONY: clean distclean install run
ENV ?= env
VENV = $(shell python -c "import sys; print(int(hasattr(sys, 'real_prefix')));")
ifeq ($(VENV),1)
GUNICORN = gunicorn
else
GUNICORN = $(ENV)/bin/gunicorn
endif
@drgarcia1986
drgarcia1986 / tornado_asyncio.py
Last active August 7, 2021 15:57
Tornado and Asyncio Mixed example
# -*- coding: utf-8 -*-
import asyncio
import re
import asyncio_redis
import tornado.concurrent
import tornado.httpclient
import tornado.web
import tornado.platform.asyncio
@ngpestelos
ngpestelos / remove-docker-containers.md
Last active March 5, 2024 20:45
How to remove unused Docker containers and images

May 8, 2018

I wrote this four years ago, so instead use this command:

$ docker rmi $(docker images -q -f dangling=true)
@Chaser324
Chaser324 / GitHub-Forking.md
Last active May 13, 2024 11:18
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j