Skip to content

Instantly share code, notes, and snippets.

View fatfingererr's full-sized avatar
Crafting fast algorithms

Ruei-Ci Wang fatfingererr

Crafting fast algorithms
View GitHub Profile
@amroamroamro
amroamroamro / README.md
Last active July 25, 2020 09:31
MEX config files for Microsoft Visual Studio 2017

XML configuration files for compiling MATLAB MEX-files using VS2017. Tested on Windows 10 64-bit with MATLAB R2016b and Visual Studio 2017 (Enterprise Edition), but it should also work with the Community Edition.

  1. First copy the files to MATLABROOT\bin\win64\mexopts (this might trigger a UAC prompt).
  2. Next run mex -setup and mex -setup C++ in MATLAB, and select VS2017 compilers.
  3. Finally test the new settings with a sample MEX-file:
>> mex -v -largeArrayDims test.cpp
@shaybix
shaybix / spacemacs.sh
Created May 29, 2016 00:41
Install Emacs and Spacemacs on Ubuntu
sudo apt-get install -y build-essential wget gcc g++ texinfo libx11-dev libxpm-dev libjpeg-dev libpng-dev libgif-dev libtiff-dev libgtk2.0-dev libncurses-dev
#Download Emacs 24.5+ source code
wget ftp://ftp.gnu.org/pub/gnu/emacs/emacs-24.5.tar.gz
tar -zxvf emacs-24.5.tar.gz
cd emacs-24.5
./configure
@wizioo
wizioo / gitignore_per_git_branch.md
Last active May 9, 2024 10:22
HowTo have specific .gitignore for each git branch

How to have specific .gitignore for each git branch

Objective

My objective is to have some production files ignored on specific branches. Git doesn't allow to do it.

Solution

My solution is to make a general .gitignore file and add .gitignore.branch_name files for the branches I want to add specific file exclusion. I'll use post-checkout hook to copy those .gitignore.branch_name in place of .git/info/exclude each time I go to the branch with git checkout branch_name.

@staltz
staltz / introrx.md
Last active May 14, 2024 18:07
The introduction to Reactive Programming you've been missing
@rcarmo
rcarmo / chekhov.hy
Created May 4, 2014 19:27
map-reduce in hylang
; Packed shepherd together with mincemeat for convenience
(import [mincemeat.shepherd [run_server]])
; chunker is temporarily broken
;(defn chunker [gen size]
; (let [[gen (iter gen)]
; [chunk []]
; (try
; (while True
; (for [_ (xrange size)]
@gramian
gramian / matlab-octave.m
Last active June 24, 2023 19:15
Octave and Matlab Snippets
%% Math %%
si = @(x) sin(x) ./ (x + (x==0)); % cardinal sine without pi multiplied argument
hsin = @(x) 0.5 * (1.0 - cos(x)); % haversed sine
hcos = @(x) 0.5 * (1.0 + cos(x)); % haversed cosine
sigm = @(x,k) 0.5 * tanh(0.5 * k * x) + 0.5; % sigmoid function to (exp(-kx)+1)^-1