#How to create a .file or .folder on Windows
There are several ways
- Create
file.txt - Rename to
.file., the last dot will be dropped, you'll have.file
Works the same with a file or a directory.
| //for zoom detection | |
| px_ratio = window.devicePixelRatio || window.screen.availWidth / document.documentElement.clientWidth; | |
| $(window).resize(function(){isZooming();}); | |
| function isZooming(){ | |
| var newPx_ratio = window.devicePixelRatio || window.screen.availWidth / document.documentElement.clientWidth; | |
| if(newPx_ratio != px_ratio){ | |
| px_ratio = newPx_ratio; | |
| console.log("zooming"); |
| """ | |
| Create train, valid, test iterators for CIFAR-10 [1]. | |
| Easily extended to MNIST, CIFAR-100 and Imagenet. | |
| [1]: https://discuss.pytorch.org/t/feedback-on-pytorch-for-kaggle-competitions/2252/4 | |
| """ | |
| import torch | |
| import numpy as np |
| // Make sure to run the code using sudo as port 80 needs sudo access | |
| const http = require('http'); | |
| const server = http.createServer((req, res) => { | |
| res.writeHead(301,{Location: `https://${req.headers.host}${req.url}`}); | |
| res.end(); | |
| }); | |
| server.listen(80); |
| # Based off of https://github.com/jupyter/notebook/blob/master/docs/source/extending/savehooks.rst | |
| import io | |
| import os | |
| from notebook.utils import to_api_path | |
| _script_exporter = None | |
| _html_exporter = None | |
| def script_post_save(model, os_path, contents_manager, **kwargs): |
| # Steps to build and install tmux from source. | |
| # Takes < 25 seconds on EC2 env [even on a low-end config instance]. | |
| VERSION=2.7 | |
| sudo yum -y remove tmux | |
| sudo yum -y install wget tar libevent-devel ncurses-devel | |
| wget https://github.com/tmux/tmux/releases/download/${VERSION}/tmux-${VERSION}.tar.gz | |
| tar xzf tmux-${VERSION}.tar.gz | |
| rm -f tmux-${VERSION}.tar.gz | |
| cd tmux-${VERSION} |
| # 0 is too far from ` ;) | |
| set -g base-index 1 | |
| # Automatically set window title | |
| set-window-option -g automatic-rename on | |
| set-option -g set-titles on | |
| #set -g default-terminal screen-256color | |
| set -g status-keys vi | |
| set -g history-limit 10000 |