-
CTRL + A
— Move to the beginning of the line -
CTRL + E
— Move to the end of the line -
CTRL + [left arrow]
— Move one word backward (on some systems this is ALT + B) -
CTRL + [right arrow]
— Move one word forward (on some systems this is ALT + F) -
CTRL + U
— (bash) Clear the characters on the line before the current cursor position -
CTRL + U
—(zsh) If you're using the zsh, this will clear the entire line -
CTRL + K
— Clear the characters on the line after the current cursor position -
ESC + [backspace]
— Delete the word in front of the cursor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(raster) | |
library(rayshader) | |
#Load QGIS georeference image (see https://www.qgistutorials.com/en/docs/3/georeferencing_basics.html) | |
testindia = raster::stack("1870_southern-india_modified.tif") | |
#Set bounding box for final map (cut off edges without data, introduced via reprojection) | |
india_bb = raster::extent(c(68,92,1,20)) | |
cropped_india = raster::crop(testindia, india_bb) | |
#Convert to RGB array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************** | |
* crispsContest.js * | |
******************** | |
* | |
* The Algorithm is almost in our grasp! | |
* At long last, we will definitively establish | |
* that 3SAT is solvable in polynomial time. It's | |
* been a long, strange journey, but it will all be | |
* worth it. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
# using expression() for the text formatting: | |
ggplot(mtcars, | |
aes(disp, | |
mpg)) + | |
geom_point() + | |
# ~ for spaces, and * for no-space between (unquoted) expressions | |
ylab(expression(Anthropogenic~SO[4]^{"2-"}~(ngm^-3))) + | |
xlab(expression(italic(delta)^13*C[ap]*"‰")) + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(ncdf4) | |
require(ncdf4.helpers) | |
require(data.table) | |
## Get the name of the value vars in the nc file | |
get_nc_value_name <- function(nc_file) { | |
## Get names | |
nc_obj <- nc_open(nc_file) | |
name<-names(nc_obj$var) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapted from https://stackoverflow.com/a/7267364/1036500 by Andrie de Vries | |
# This is it: theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5)) | |
library(ggplot2) | |
td <- expand.grid( | |
hjust=c(0, 0.5, 1), | |
vjust=c(0, 0.5, 1), | |
angle=c(0, 45, 90), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There are two ways for using tensorboard on a remote server: | |
--1. Use sshfs. | |
However, I found that this method is pretty slow, in particular if you want to compare several different long runs in tensorboard. | |
--2. ssh with a port forwarding: | |
ssh -L 16006:127.0.0.1:6006 user@remote | |
Then, on your local machine simply open | |
http://127.0.0.1:16006/ |
1 typical CPU instruction .................. 1 ns
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' When plotting multiple data series that share a common x axis but different y axes, | |
#' we can just plot each graph separately. This suffers from the drawback that the shared axis will typically | |
#' not align across graphs due to different plot margins. | |
#' One easy solution is to reshape2::melt() the data and use ggplot2's facet_grid() mapping. However, there is | |
#' no way to label individual y axes. | |
#' facet_grid() and facet_wrap() were designed to plot small multiples, where both x- and y-axis ranges are | |
#' shared acros all plots in the facetting. While the facet_ calls allow us to use different scales with | |
#' the \code{scales = "free"} argument, they should not be used this way. | |
#' A more robust approach is to the grid package grid.draw(), rbind() and ggplotGrob() to create a grid of | |
#' individual plots where the plot axes are properly aligned within the grid. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Byobu Commands | |
============== | |
byobu Screen manager | |
Level 0 Commands (Quick Start) | |
------------------------------ | |
<F2> Create a new window |
NewerOlder