Skip to content

Instantly share code, notes, and snippets.

@dandanwei
dandanwei / pre-commit
Last active February 8, 2017 12:56
Pre-commit hook to run pyflakes and autopep8 for updated codes. Shall be added to folder .git/hooks/
#!/usr/bin/env bash
# Script to run before doing a commit. This will run autopep8 and any unit tests it can find.
# Place this script in .git/hooks/ directory of your repo and rename it pre-commit (no extension)
# To have this file copied to every new repo you created, place it in $HOME/.git_template/hooks/pre-commit
# NOTES:
# 1. This is an opinionated script, following the notion that code formatting issues are the most contentious but the
# least consequential. As such it borrows a page from Go and lets the machine decide on the formatting. Concretely,
# this means that any PEP8 violations will be fixed before commit, so long as the semantics of the code aren't changed
<?xml version='1.0' encoding='UTF-8' ?>
<!-- Schema for the SOAP/1.1 encoding
Portions © 2001 DevelopMentor.
© 2001 W3C (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved.
This document is governed by the W3C Software License [1] as described in the FAQ [2].
[1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
[2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
@dandanwei
dandanwei / README
Last active July 19, 2018 09:09
Jump mouse cursor between 2 screens and remember the last location
> git clone https://github.com/BlueM/cliclick.git
> cd cliclick
> make
> echo '800,10' > ~/.screen_jump
copy cliclick to /usr/local/bin/
copy screen_jump.sh to /usr/local/bin
prepare automator or applescript or BetterTouchTool to run the terminal script /usr/local/bin
DONE!
@dandanwei
dandanwei / osx_egpu_pytorch_fastai.md
Last active February 16, 2023 10:22
Make Nvidia EGPU working on mac os with Pytorch and Fast.ai

[Updated on 2018.11.14] I finally made my GTX1070 working with my MBP for Pytorch and fast.ai. Below are the steps:

Environment

  • MacBook Pro (15-inch, 2016) with touch bar
  • OSX version: 10.13.6 (Mojave may not work yet as of now)
  • eGPU: Razer Core X + GTX 1070 (MSI)

Steps 1: Install Nvidia Web Driver