Use these commands to run a jupyter server on a remote server and access it locally in a browser. You must have SSH access to the browser. Use any port you want.
Do not forget to change username@server to the correct value!
| where | using | command |
|---|
| """ | |
| Export a Conda environment with --from-history, but also append | |
| Pip-installed dependencies | |
| Exports only manually-installed dependencies, excluding build versions, but | |
| including Pip-installed dependencies. | |
| Lots of issues requesting this functionality in the Conda issue tracker, | |
| e.g. https://github.com/conda/conda/issues/9628 |
| import torch | |
| import torch.nn as nn | |
| from torch.autograd import Variable | |
| from torch.nn import functional as F | |
| """ | |
| Blog post: | |
| Taming LSTMs: Variable-sized mini-batches and why PyTorch is good for your health: | |
| https://medium.com/@_willfalcon/taming-lstms-variable-sized-mini-batches-and-why-pytorch-is-good-for-your-health-61d35642972e | |
| """ |
| #/usr/bin/env python3 | |
| import time | |
| import threading | |
| import functools | |
| import tqdm | |
| def long_running_function(*args, **kwargs): |
| SLIDES := $(patsubst %.md,%.md.slides.pdf,$(wildcard *.md)) | |
| HANDOUTS := $(patsubst %.md,%.md.handout.pdf,$(wildcard *.md)) | |
| all : $(SLIDES) $(HANDOUTS) | |
| %.md.slides.pdf : %.md | |
| pandoc $^ -t beamer --slide-level 2 -o $@ | |
| %.md.handout.pdf : %.md | |
| pandoc $^ -t beamer --slide-level 2 -V handout -o $@ |
| git branch -m old_branch new_branch # Rename branch locally | |
| git push origin :old_branch # Delete the old branch | |
| git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
| {% extends 'base.html' %} | |
| {% import 'macros.html' as macros %} | |
| {% block content %} | |
| <div class="row"> | |
| <div class="col-xs-12 col-md-3 col-sm-4 col-sm-offset-4 col-md-offset-4 col-lg-3 col-lg-offset-4"> | |
| <div class="login-message"> | |
| Login to AwesomeService! | |
| </div> | |
| {% call macros.render_form(form, action_url=url_for('login_view'), action_text='Login', | |
| class_='login-form') %} |
If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.
Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.
The simplest way to add an alias for a specific git command is to use a standard bash alias.
# .bashrc| from collections import namedtuple | |
| from pymongo import MongoClient | |
| from flask import request | |
| from core.web.site import app | |
| from core.web.site.views_master import * | |
| import json | |
| ''' | |
| $('#companies').dataTable( { | |
| "bProcessing": true, |
| {% macro form_field(field) -%} | |
| {% set with_label = kwargs.pop('with_label', False) %} | |
| {% set placeholder = '' %} | |
| {% if not with_label %} | |
| {% set placeholder = field.label.text %} | |
| {% endif %} | |
| <div class="control-group {% if field.errors %}error{% endif %}"> | |
| {% if with_label %} | |
| <label for="{{ field.id }}" class="control-label"> | |
| {{ field.label.text }}{% if field.flags.required %} *{% endif %}: |