Skip to content

Instantly share code, notes, and snippets.

View yandy's full-sized avatar

Michael Ding yandy

View GitHub Profile
@gocarlos
gocarlos / Eigen Cheat sheet
Last active September 21, 2025 15:37
Cheat sheet for the linear algebra library Eigen: http://eigen.tuxfamily.org/
// A simple quickref for Eigen. Add anything that's missing.
// Main author: Keir Mierle
#include <Eigen/Dense>
Matrix<double, 3, 3> A; // Fixed rows and cols. Same as Matrix3d.
Matrix<double, 3, Dynamic> B; // Fixed rows, dynamic cols.
Matrix<double, Dynamic, Dynamic> C; // Full dynamic. Same as MatrixXd.
Matrix<double, 3, 3, RowMajor> E; // Row major; default is column-major.
Matrix3f P, Q, R; // 3x3 float matrix.
/* The Grid ---------------------- */
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row.large-collapse .column,
.lt-ie9 .row.large-collapse .columns { padding: 0; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row .row.large-collapse { margin: 0; }
.lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; }
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; }
@maffoo
maffoo / matlab.py
Created August 6, 2012 14:36
Invoke matlab from python
import os
import subprocess
import tempfile
import numpy as np
def processMatrix(in_, funcStr):
"""Process the given matrix with MATLAB.
Uses temporary files to save the real and imaginary parts of the
@josiahcarlson
josiahcarlson / chunked_server_test.py
Last active October 15, 2025 03:22
Use some standard Python libraries to implement a chunked-transfer encoding web server with partially-working gzip support
'''
chunked_server_test.py
Copyright August 3, 2012
Released into the public domain
This implements a chunked server using Python threads and the built-in
BaseHTTPServer module. Enable gzip compression at your own peril - web
browsers seem to have issues, though wget, curl, Python's urllib2, my own
async_http library, and other command-line tools have no problems.
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active October 31, 2025 20:47
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@bryanchow
bryanchow / jquery.jscrollpane-startstop.js
Created March 3, 2012 01:54
Custom start and stop scrolling events for jQuery.jScrollPane
/*jshint browser:true */
/*global jQuery */
/*
jquery.scrollpane-startstop.js
Custom start and stop scrolling events for jScrollPane
https://gist.github.com/1963544
Usage: