Skip to content

Instantly share code, notes, and snippets.

View ibarraespinosa's full-sized avatar
🇨🇱
https://ibarraespinosa.github.io/

Sergio Ibarra Espinosa ibarraespinosa

🇨🇱
https://ibarraespinosa.github.io/
View GitHub Profile
@MihailCosmin
MihailCosmin / cuda_11.8_installation_on_Ubuntu_22.04
Last active May 2, 2024 12:46 — forked from primus852/cuda_11.7_installation_on_Ubuntu_22.04
Instructions for CUDA v11.8 and cuDNN 8.7 installation on Ubuntu 22.04 for PyTorch 2.0.0
#!/bin/bash
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
### to verify your gpu is cuda enable check
tm <- quadmesh::triangmesh(volcano)
xyzg <- tibble::tibble(x = tm$vb[1, tm$it], 
                       y = tm$vb[2, tm$it], 
                       z = tm$vb[3, tm$it], 
                       g = rep(seq_len(ncol(tm$it)), each = nrow(tm$it)))
library(ggplot2)
ggplot(xyzg, aes(x, y, group = g, fill = z)) + 
  geom_polygon()
@benjamin-chan
benjamin-chan / R.nanorc
Last active May 7, 2023 17:46
R syntax highlighting for nano editor
################################################################################
#
# R.nanorc -- nano syntax-highlighting file for R
#
# Origin: This file is part of the pkgutils package for R.
#
# Usage: This file should be placed in a directory such as /usr/share/nano/ (on
# Ubuntu 12.04). That nano uses syntax highlighting at all might need to be
# enabled separately.
@jeroen
jeroen / fortran.R
Created September 16, 2015 10:11
Find CRAN packages with FORTRAN code
# Find all CRAN package with FORTRAN code
packages <- c()
base_url <- 'https://api.github.com/search/repositories?q=user:cran%20language:fortran'
for(page in 1:100){
url <- paste0(base_url, "&page=", page)
cat("Reading", url, "\n")
repos <- jsonlite::fromJSON(url)
if(!length(repos$items))
break
packages <- c(packages, repos$items$name)
@jslefche
jslefche / README.md
Last active May 29, 2022 00:23
ggplot2: theme_black()

Black theme for ggplot2

This is an additional theme for ggplot2 that generates an inverse black and white color scheme.

Example

ggplot(mtcars, aes(wt, mpg)) + geom_point()
# Add theme_black()
ggplot(mtcars, aes(wt, mpg)) + geom_point(color = "white") + theme_black()
@jennybc
jennybc / reverse-categorical-axis-ggplot2.r
Created October 10, 2014 01:06
Reverse the order of a categorical axis in ggplot2
scale_x_discrete(limits = rev(levels(the_factor)))