Skip to content

Instantly share code, notes, and snippets.

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

genzj genzj

👽
你现在最大的问题是做了人类
View GitHub Profile
@tinogomes
tinogomes / DNS_TO_LOCALHOST.markdown
Last active May 10, 2024 04:36
Public DNS Pointing to localhost (127.0.0.1)

Available Public Wildcard DNS Domains pointing to localhost (127.0.0.1)

The best way to safely and securely use local domains pointing to 127.0.0.1 is to edit your local settings (/etc/hosts) and add your own settings. Keep in mind if you want to use subdomains, you need to enter all variations.

Example:

# Adding bottom of your current file /etc/hosts
################# MY LOCAL DOMAINS
127.0.0.1 local.com admin.local.com
127.0.0.1 domain1.com
@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
@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
@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).
@gka
gka / make-animated-gifs-using-ffmpeg.md
Last active January 16, 2024 22:03
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.

@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')
@DocX
DocX / README.md
Last active September 5, 2023 12:58
Connect to bash inside running ECS container by cluster and service name
# -*- 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
@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):
@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'
}