Skip to content

Instantly share code, notes, and snippets.

View hankliu5's full-sized avatar
🐶

Yu-Chia "Hank" Liu hankliu5

🐶
View GitHub Profile
@githubfoam
githubfoam / Mellanox OFED cheat sheet
Last active July 3, 2024 18:48
Mellanox OFED cheat sheet
--------------------------------------------------------------------------
# ofed_info -s
--------------------------------------------------------------------------
Find Mellanox Adapter Type and Firmware/Driver version
ConnectX-4 card
# lspci | grep Mellanox
0a:00.0 Network controller: Mellanox Technologies MT27500 Family [ConnectX-3]
# lspci -vv -s 0a:00.0 | grep "Part number" -A 3
# lspci | grep Mellanox | awk '{print $1}' | xargs -i -r mstvpd {}
@TysonRayJones
TysonRayJones / gsl_on_osx_and_arcus_guide.md
Last active April 26, 2024 19:22
GSL on OSX, Ubuntu and ARCUS

this guide may be outdated for MacOS versions beyond 10.14 Mojave (and implied Xcode versions)

GSL

Table of Contents

@calebmadrigal
calebmadrigal / rewrite_strings.py
Created August 24, 2017 20:29
Example of changing the python AST
import ast
class StringWrapper(ast.NodeTransformer):
"""Wraps all strings in 'START ' + string + ' END'. """
def visit_Str(self, node):
return ast.Call(func=ast.Name(id='wrap_string', ctx=ast.Load()),
args=[node], keywords=[])
def wrap_string(s):
return 'START ' + s + ' END'
from __future__ import print_function
import pickle
try:
import cPickle
test_cPickle = True
except:
test_cPickle = False
import json
import marshal
import timeit
@juderosen
juderosen / git-wars.md
Last active April 25, 2024 15:16
Git Wars: GitHub vs Bitbucket

Git Wars: GitHub vs Bitbucket

Introduction

Now, you might think the answer I'm going to give you is already obvious because I'm using GiHub right now, but it's not. Both GitHub and Bitbucket offer great Git services, but each has its own features and pricing plans. In the following... thing, I'm going to compare the two and then offer a final solution that should work for most people.

TL;DR: Both. Use GitHub for open source and public repos (you'll spend most of your time here) and Bitbucket for private repos. But, sign up for GitHub first, then import account into Bitbucket. Also, check comments for updates. P.S. I personally prefer GitHub.

Interface and Functionality

@rxaviers
rxaviers / gist:7360908
Last active July 5, 2024 04:46
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@carlosmcevilly
carlosmcevilly / gist:2221249
Created March 27, 2012 22:55
fix git commit with wrong email address in git config, before pushing
If:
- you add and commit with the wrong email address in git, and
- your remote has a hook set up to prevent you from pushing with the bad address
Then you need to amend the author of your commit before push can succeed:
1. fix your email address in git config:
$ git config user.name "Your Name"
@GaelVaroquaux
GaelVaroquaux / 00README.rst
Last active September 15, 2023 03:58
Copy-less bindings of C-generated arrays with Cython

Cython example of exposing C-computed arrays in Python without data copies

The goal of this example is to show how an existing C codebase for numerical computing (here c_code.c) can be wrapped in Cython to be exposed in Python.

The meat of the example is that the data is allocated in C, but exposed in Python without a copy using the PyArray_SimpleNewFromData numpy