Skip to content

Instantly share code, notes, and snippets.

View genzj's full-sized avatar
👽
你现在最大的问题是做了人类

genzj genzj

👽
你现在最大的问题是做了人类
View GitHub Profile
@plentz
plentz / nginx.conf
Last active April 3, 2025 19:20
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@catermelon
catermelon / config.py
Created October 4, 2013 15:49
Flask-SQLAlchemy - separating reads and writes
# This is not used unless SQLALCHEMY_BINDS is not present
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://{username}:{password}@{hostname}/{database}?charset=utf8'
SQLALCHEMY_BINDS = {
'master': 'mysql+pymysql://{username}:{password}@{hostname}/{database}?charset=utf8',
'slave': 'mysql+pymysql://{username}:{password}@{hostname}/{database}?charset=utf8'
}
@ducin
ducin / console.py
Last active January 1, 2022 16:41
Python script opening interactive console with current interpreter state. Thanks to readline/rlcompleter, you may use up/down arrows (history browse) or left/right arrows (line edition), see http://stackoverflow.com/questions/19754458/python-open-interactive-console-from-script)
"""
Console module provide `copen` method for opening interactive python shell in
the runtime.
"""
import code
import readline
import rlcompleter
def copen(_globals, _locals):
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'threading_design.ui'
#
# Created: Thu Aug 6 13:47:18 2015
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
@DocX
DocX / README.md
Last active September 5, 2023 12:58
Connect to bash inside running ECS container by cluster and service name
@smidm
smidm / pkgconfig.py
Created June 23, 2016 08:38
pkg-config python wrapper for building extensions with distutils
import subprocess
def pkgconfig(*packages, **kw):
"""
Query pkg-config for library compile and linking options. Return configuration in distutils
Extension format.
Usage:
pkgconfig('opencv')
@gka
gka / make-animated-gifs-using-ffmpeg.md
Last active August 23, 2024 00:23
how to make a nice GIF from png frames

Make sure ffmpeg is up-to-date:

brew update
brew upgrade ffmpeg

Convert a MOV into frames. Tweak the 2/1 if you want more or fewer frames.

@BMeu
BMeu / raspbian-python3.5.rst
Created October 12, 2016 19:16
Installing Python 3.5 on Raspbian

Installing Python 3.5 on Raspbian

As of October 2016, Raspbian does not yet include the latest Python release, Python 3.5. This means we will have to build it ourselves, and here is how to do it.

  1. Install the required build-tools (some might already be installed on your system).
@rishabhbhardwaj
rishabhbhardwaj / titanic_dt_kaggle.py
Last active July 17, 2018 13:35
Decision Tree classification using sklearn Python for Titanic Dataset
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 28 13:51:26 2016
@author: rishabh
"""
import pandas as pd
import numpy as np
@jonatansberg
jonatansberg / 0. Create React App (CRA) with TypeScript and Emotion.md
Last active December 21, 2020 15:47
Create React App (CRA) with TypeScript and Emotion

Set up CRA with TypeScript and Emotion

Follow the steps below to use babel together with ts-loader so that you can use emotion (or any other Babel plugin) in your React and TypeScript project.

$ create-react-app my-app --scripts-version=react-scripts-ts