Skip to content

Instantly share code, notes, and snippets.

View xingfeT's full-sized avatar

luoxing xingfeT

  • Central China Normal University
  • Wuhan,China
View GitHub Profile
@mmodenesi
mmodenesi / Makefile
Created August 31, 2019 23:40
pybind use case example
INCLUDES = $(shell python3 -m pybind11 --includes)
LIBS = -lpython3.6m
CCFLAGS = -O3 -Wall -shared -std=c++11 -fPIC
CC = g++
MODULE = someclass$(shell python3-config --extension-suffix)
TARGET = program
SOURCES = $(wildcard *.cc)
all: binding build
@wronk
wronk / python_environment_setup.md
Last active May 14, 2024 21:10
Setting up your python development environment (with pyenv, virtualenv, and virtualenvwrapper)

Overview of Python Virtual Environments

This guide is targetted at intermediate or expert users who want low-level control over their Python environments.

When you're working on multiple coding projects, you might want a couple different version of Python and/or modules installed. This helps keep each workflow in its own sandbox instead of trying to juggle multiple projects (each with different dependencies) on your system's version of Python. The guide here covers one way to handle multiple Python versions and Python environments on your own (i.e., without a package manager like conda). See the Using the workflow section to view the end result.


h/t @sharkinsspatial for linking me to the perfect cartoon

@omartrigui
omartrigui / make-swap.sh
Last active August 9, 2023 02:33
Create 4G swap file in Linux
#!/bin/bash
dd if=/dev/zero of=/swapfile bs=1024 count=$((1024 * 1024 * 4))
chown root:root /swapfile
chmod 0600 /swapfile
mkswap /swapfile
swapon /swapfile
echo "/swapfile none swap sw 0 0" >> /etc/fstab
@puffnfresh
puffnfresh / Monoid.v
Created April 24, 2014 15:08
Verified monoid in Coq.
Inductive bool : Type :=
| true : bool
| false : bool.
Class Monoid (A : Type) :=
{
empty : A ;
append : A -> A -> A ;
left_neutrality : forall x, append empty x = x ;