Skip to content

Instantly share code, notes, and snippets.

View dawnsong's full-sized avatar
💭
Working for a better understanding of human brain

Xiaowei Song dawnsong

💭
Working for a better understanding of human brain
View GitHub Profile
@dawnsong
dawnsong / anaconda4cygwin.bash_profile
Created May 18, 2022 11:35
Setup anaconda to run within Cygwin environment
#https://stackoverflow.com/questions/36969824/using-anaconda-environments-with-cygwin-on-windows
# Anaconda Environment Selection - Plese set CONDA_BASE_DIR to the directory
# containing the base installation of anaconda/miniconda.
export CONDA_BASE_DIR=/cygdrive/d/Anaconda3
# Proxy Servers & Network Setup (if needed)
export HTTP_PROXY=
export HTTPS_PROXY=
@dawnsong
dawnsong / flask-port80-without-sudo.md
Created January 23, 2022 22:53 — forked from justinmklam/flask-port80-without-sudo.md
Run a flask app on port 80 without sudo.

Flask apps are bound to port 5000 by default. To bind it to port 80, you would need to change the port as follows:

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=80, debug=True)

And to run it:

@dawnsong
dawnsong / lut_convertToFslview.sh
Created June 20, 2017 19:00 — forked from stowler/lut_convertToFslview.sh
lut_convertToFslview.sh : an unsafe proof-of-concept bash script for converting LUTs to fslview LUTs
#!/bin/bash
#
# CALL AS: lut_convertToFslview.sh
# (no arguments: input and output files defined below)
#
# CREATED: 20130430 by stowler@gmail.com
# LAST UPDATED: same
#
#
#
@dawnsong
dawnsong / memusg
Created January 20, 2017 21:06 — forked from netj/memusg
memusg -- Measure memory usage of processes
#!/usr/bin/env bash
# memusg -- Measure memory usage of processes
# Usage: memusg COMMAND [ARGS]...
#
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2010-08-16
############################################################################
# Copyright 2010 Jaeho Shin. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
@dawnsong
dawnsong / go2turinglib.js
Created April 27, 2016 13:27
Load paper in Turing Library of Northwestern
var parser = document.createElement('a');
parser.href = window.location.href ;
console.debug(parser.hostname) ;
parser.hostname=parser.hostname+'.turing.library.northwestern.edu' ;
console.debug(parser.href) ;
window.location.href=parser.href ;
@dawnsong
dawnsong / 0_reuse_code.js
Created January 10, 2016 06:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@dawnsong
dawnsong / springer-free-maths-books.md
Created December 29, 2015 23:31 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of books available for free, here are the direct links
'''
Non-parametric computation of entropy and mutual-information
Adapted by G Varoquaux for code created by R Brette, itself
from several papers (see in the code).
These computations rely on nearest-neighbor statistics
'''
import numpy as np
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@dawnsong
dawnsong / warpinfo.rst
Last active January 20, 2017 21:10 — forked from satra/warpinfo.rst