Skip to content

Instantly share code, notes, and snippets.

@juliasilge
juliasilge / student_mobility.md
Created March 10, 2022 00:09
Network graph for #TidyTuesday ERASMUS student mobility
library(tidyverse)
library(igraph)
#> 
#> Attaching package: 'igraph'
#> The following objects are masked from 'package:dplyr':
#> 
#>     as_data_frame, groups, union
#> The following objects are masked from 'package:purrr':
#> 
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>RSS subscriptions for chris.albon@gmail.com</title>
<dateCreated>Sat, 27 Feb 2021 17:33:45 +0000</dateCreated>
<ownerEmail>chris.albon@gmail.com</ownerEmail>
</head>
<body>
<outline text="Google AI Blog" title="Google AI Blog" type="rss" xmlUrl="http://feeds.feedburner.com/blogspot/gJZg" htmlUrl="http://ai.googleblog.com/"/>
<outline text="FastML" title="FastML" type="rss" xmlUrl="http://fastml.com/atom.xml" htmlUrl="http://fastml.com/"/>
# -*- coding: utf-8 -*-
""" Deletes all tweets below a certain retweet threshold.
"""
import tweepy
from datetime import datetime
# Constants
CONSUMER_KEY = ''
@movd
movd / DeRancilio.md
Created June 26, 2020 20:50
Delonghi Dedica 680 Rancilio Silvia wand modification (originally created by Chris Faulds)

This very detailed guide was originally written by Chris Faulds and used to be available at cfdesign.work/derancilio. Unfortunately, his website is no longer online. Thanks to the Wayback Machine the article is still readable. But since the presentation is a bit wonky, I decided to mirror his awesome tutorial is this gist.

Chris has spent a huge amount of time writing an in-depth instruction on how to take the machine apart, which may also come in handy for other repairs for the Dedica 680/685. Again all credits go to him. Thanks a lot for the great work!

DeRancilio Index Banner

Delonghi Dedica 680 Rancilio Silvia wand modification

Monday 1st August 2016

@alistaire47
alistaire47 / markdown.R
Last active October 18, 2018 19:41
read markdown table into R data frame
# base R version
read.markdown <- function(file, stringsAsFactors = FALSE, strip.white = TRUE, ...){
if (length(file) > 1) {
lines <- file
} else if (grepl('\n', file)) {
con <- textConnection(file)
lines <- readLines(con)
close(con)
} else {
lines <- readLines(file)
@Revod
Revod / Material Theme.itermcolors
Created November 6, 2016 22:14
Material Theme For iTerm2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Color Space</key>
<string>sRGB</string>
<key>Blue Component</key>
<real>0.25882352941176473</real>
@friendly
friendly / boxM.R
Created February 10, 2016 15:12
Box's M-test for Homogeneity of Covariance Matrices
# Box's M-test for Homogeneity of Covariance Matrices
boxM <-
function(mod, ...) UseMethod("boxM")
boxM.default <- function(Y, group)
{
dname <- deparse(substitute(Y))
if (!inherits(Y, c("data.frame", "matrix")))
@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()
@karpathy
karpathy / min-char-rnn.py
Last active May 4, 2024 17:44
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@nskeip
nskeip / multiple_csv.R
Created June 12, 2014 12:18
Read multiple CSV files into a single dataframe
create_big_data_from_csv_dir <- function(directory, ids) {
# locate the files
files <- list.files(directory, full.names=T)[ids]
# read the files into a list of data.frames
data.list <- lapply(files, read.csv)
# concatenate into one big data.frame
data.cat <- do.call(rbind, data.list)