Skip to content

Instantly share code, notes, and snippets.

@yaowenqiang
yaowenqiang / README.md
Created March 10, 2025 12:44 — forked from Potherca/README.md
HOWTO: Skip files outside PhpStorm project in Xdebug sessions

Introduction

In PHP development environments, it is not entirely uncommon to use an auto_prepend_file to add development-specific functionality to an application. Usually such a file is used for several projects at the same time. This means the prepend file resides somewhere in a more high-level location.

A more common practice is to use Xdebug te debug PHP code.

When combining these two with PhpStorm this will lead to the prepend file being marked as "not mapped".

Problem

@yaowenqiang
yaowenqiang / uwsgi_custom_build.md
Created January 22, 2025 02:45 — forked from bendavis78/uwsgi_custom_build.md
Building uwsgi w/ support multiple python versions

Installation

Remove all traces of uwsgi on the system, if previously installed

apt remove uwsgi uwsgi-core
rm /usr/bin/uwsgi
rm /usr/local/bin/uwsgi
rm -rf /usr/lib/uwsgi
rm -rf /usr/local/lib/uwsgi

Any config files in /etc can stay.

yum install libmpc-devel mpfr-devel gmp-devel
cd /usr/src/
curl ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.9.3/gcc-4.9.3.tar.bz2 -O
tar xvfj gcc-4.9.3.tar.bz2
cd gcc-4.9.3
./configure --disable-multilib --enable-languages=c,c++
make -j `grep processor /proc/cpuinfo | wc -l`
make install
@yaowenqiang
yaowenqiang / sql_primer.md
Created August 12, 2024 01:16 — forked from lionelbarrow/sql_primer.md
SQL primer

SQL Primer

While there are plenty of good tutorials for SQL on the Internet, I didn't find anything that set the up the historical context and "assumed understanding" of SQL very well, so I decided to write a short primer on the topic. Here's what we'll cover:

  • What is SQL?
  • The SQL programmng language
  • Databases and SQL
  • Schemas and queries

What is SQL?

@yaowenqiang
yaowenqiang / overview.md
Created January 22, 2024 12:14 — forked from max-itzpapalotl/overview.md
"Rust = Future<C++>" overview

Rust = Future<C++>

In this channel I introduce Rust for people who know C++ already. The videos are supposed to be short and cover only a single topic. Each video comes with a github gist, which contains all the code and commands for copy/paste, such that you can easily try out things. Furthermore, there are links to the excellent Rust documentation.

This is still work in progress. As you can see in the table below,

@yaowenqiang
yaowenqiang / auto-refresh-mendeley-token.py
Created November 8, 2023 16:06 — forked from franfabrizio/auto-refresh-mendeley-token.py
Python example using refresh token to update access token for Mendeley API using the Mendeley Python SDK
from mendeley import Mendeley
from mendeley.exception import MendeleyException
from mendeley.session import MendeleySession
# extending the MendeleySession class to do auto-token-refresh on
# token expiration. Mendeley access tokens expire after 1 hour.
class AutoRefreshMendeleySession(MendeleySession):
def __init__(self, mendeley, token, refresh_token):
super(AutoRefreshMendeleySession, self).__init__(mendeley, token)
# silly name to avoid namespace collision with oauth refresh_token() method
@yaowenqiang
yaowenqiang / Makefile
Created October 20, 2023 00:58 — forked from LiquidityC/Makefile
Generic drop in Makefile
VERSION = \"1.0.0\"
PREFIX ?= out
INCDIR = inc
SRCDIR = src
LANG = c
OBJDIR = .obj
MODULE = binary_name
CC = gcc
@yaowenqiang
yaowenqiang / docker-registry-mirrors.md
Created July 20, 2023 07:26 — forked from y0ngb1n/docker-registry-mirrors.md
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+