Skip to content

Instantly share code, notes, and snippets.

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@paperwise
paperwise / TeamJobPost.md
Created March 4, 2019 05:50
Job Post: TensorFlow TPU, Swift for TensorFlow, and ML Compiler Infrastructure Teams

TensorFlow TPU, Swift for TensorFlow, and ML Compiler Infrastructure Teams

Google is an “AI first” company and Google Brain is making major investments to build out infrastructure for existing accelerators such as Cloud TPUs and GPUs as well as the coming wave of “edge” accelerators for mobile, automotive, AIY, and other low-power applications. Our infrastructure is pervasively open-source, and covers all levels of the stack - from compilers and programming languages, to high-performance runtimes, to production ML model development, support for multiple ML frameworks, and includes research on large batch training and other novel applications of these accelerators.

We are looking to hire for a significant number of positions in the areas listed below, including a number of technical leadership and manage

@paperwise
paperwise / encrypted-git-repo.md
Created December 8, 2018 05:56
Transparent Git Encryption

Transparent Git Encryption

This document has been modified from its [original format][m1], which was written by Ning Shang ([email protected]). It has been updated and reformatted into a [Markdown][m2] document by [Woody Gilk][m3] and [republished][m4].

Description

When working with a remote git repository which is hosted on a third-party storage server, data confidentiality sometimes becomes

@paperwise
paperwise / BUILD
Created December 6, 2018 01:50 — forked from bsilver8192/BUILD
Basics of generating a compile_commands.json file with Bazel
py_binary(
name = 'generate_compile_command',
srcs = [
'generate_compile_command.py',
],
deps = [
'//third_party/bazel:extra_actions_proto_py',
],
)
@paperwise
paperwise / python_decorator_guide.md
Created November 28, 2018 07:54 — forked from Zearin/python_decorator_guide.md
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.


Q: How can I make a chain of function decorators in Python?


If you are not into long explanations, see [Paolo Bergantino’s answer][2].

#!/bin/bash
# Depends on git, curl, jq
BAK_DIR=$(date +"%y%m%d-%H%M")
GISTS_URL="https://api.github.com/users/$USER/gists?per_page=1000&access_token=$GITHUB_ACCESS_TOKEN"
mkdir "$BAK_DIR" && cd "$BAK_DIR" && curl -s "$GISTS_URL" | jq ".[] | .git_pull_url" | xargs -n1 git clone
@paperwise
paperwise / System Design.md
Created October 8, 2018 07:55 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@paperwise
paperwise / get_gists.py
Created September 30, 2018 06:48 — forked from leoloobeek/get_gists.py
Download all gists for a specific user
# first: mkdir user && cd user && cp /path/to/get_gists.py .
# python3 get_gists.py user
import requests
import sys
from subprocess import call
user = sys.argv[1]
r = requests.get('https://api.github.com/users/{0}/gists'.format(user))