Skip to content

Instantly share code, notes, and snippets.

View tmpethick's full-sized avatar

Thomas Pethick tmpethick

View GitHub Profile
"""
Example:
conda activate environment
CUDA_VISIBLE_DEVICES=0 python job_listener --job-dir jobs/
See the JobListener class for more detail.
"""
import signal
import os
@tmpethick
tmpethick / next-authentication.js
Last active April 26, 2017 23:13
Next authentication with react-cookie as requested by https://twitter.com/MrLoh/status/856184129150431237
import cookie from 'react-cookie';
import Router from 'next/router';
import { create } from 'apisauce';
// Authenticate with a JWT retrieved through some API call.
export const authenticate = token => {
cookie.save('userToken', token, { path: '/' }); // Stores token for later auth check.
Router.push('/profile'); // Navigates.
};
@tmpethick
tmpethick / introrx.md
Created April 17, 2017 19:02 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing