Skip to content

Instantly share code, notes, and snippets.

View zhanwenchen's full-sized avatar
🤠
Howdy y'all

Zhanwen Chen zhanwenchen

🤠
Howdy y'all
View GitHub Profile
@MInner
MInner / gpu_profile.py
Created September 12, 2017 16:11
A script to generate per-line GPU memory usage trace. For more meaningful results set `CUDA_LAUNCH_BLOCKING=1`.
import datetime
import linecache
import os
import pynvml3
import torch
print_tensor_sizes = True
last_tensor_sizes = set()
gpu_profile_fn = f'{datetime.datetime.now():%d-%b-%y-%H:%M:%S}-gpu_mem_prof.txt'
@apdavison
apdavison / demo.py
Created September 7, 2017 13:56
Demonstration of parallel writing to file using h5py and mpi4py
"""
Creates an HDF5 file with a single dataset of shape (channels, n),
filled with random numbers.
Writing to the different channels (rows) is parallelized using MPI.
Usage:
mpirun -np 8 python demo.py
Small shell script to run timings with different numbers of MPI processes:
@ahelord
ahelord / sequelize-schema-file-generator.js
Last active September 14, 2021 13:40 — forked from manuelbieh/sequelize-schema-file-generator.js
Automatically generates migration files from your sequelize models
'use strict';
//////////////////////////////////
// How to use?
// 1. Create `sequelize-schema-file-generator.js` in your app root
// 2. Make sure you've ran the `sequelize init` before (It should create `config`,`seeders`,`migrations` folders).
// 3. Update `DATABASE_DSN` below to match your connection string (works with any database adapter that Sequelize supports)
// 4. Run it with `node sequelize-schema-file-generator.js`
// 5. Review the generated migrations inside of the `migrations` folder.
//////////////////////////////////
@MartijnBraam
MartijnBraam / config
Created March 2, 2017 20:38
SSH jumphost shortcut
Host *+*
ProxyCommand ssh $(echo %h | sed 's/+[^+]*$//;s/\([^+%%]*\)%%\([^+]*\)$/\2 -l \1/;s/:/ -p /') exec nc -w1 $(echo %h | sed 's/^.*+//;/:/!s/$/ %p/;s/:/ /')
@wangruohui
wangruohui / Install NVIDIA Driver and CUDA.md
Last active May 17, 2024 09:02
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS
@WarrenWeckesser
WarrenWeckesser / remez_examples.py
Last active April 20, 2021 15:58
Examples of designing a FIR filter with scipy.signal.remez.
from __future__ import division, print_function
import numpy as np
from scipy import signal
import matplotlib.pyplot as plt
def plot_response(fs, w, h, title):
plt.figure()
plt.plot(0.5*fs*w/np.pi, 20*np.log10(np.abs(h)))
@tracker1
tracker1 / 01-directory-structure.md
Last active May 4, 2024 19:55
Anatomy of a JavaScript/Node project.

Directory structure for JavaScript/Node Projects

While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.

Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.

Directories

  • lib/ is intended for code that can run as-is
  • src/ is intended for code that needs to be manipulated before it can be used
@digitaljhelms
digitaljhelms / gist:4287848
Last active May 20, 2024 15:49
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch