Skip to content

Instantly share code, notes, and snippets.

View ColinConwell's full-sized avatar

Colin Conwell ColinConwell

  • Harvard University, Department of Psychology
  • Cambridge, Ma
View GitHub Profile
@GeorgeDittmar
GeorgeDittmar / lm-huggingface-finetune-gpt-2.ipynb
Created January 1, 2021 00:33
LM Huggingface finetune GPT-2.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@deepanchal
deepanchal / BiblioBot.py
Created April 22, 2020 00:27
A python bot which takes multiple article links and automates your GUI to generate citations from (zbib.org)
import pyautogui
import webbrowser
import time
import tkinter as tk
from tkinter import messagebox
url = "https://zbib.org/"
instructions = "This bot needs to have access to you keyboard and mouse to function.\nPlease don't mess with keyboard or cursor while this bot is running\nTo use this bot, copy and paste all your article(references) website links in the textbox.\nPlease make sure that every link is on newline or else bot won't work.\nDon't worry, its just a bot, not A.I. ;)\n"
require(dplyr)
require(ggplot2)
# make sure that purrr package is installed to use purrr::set_names
# aggregate data
df = mpg %>%
group_by(year, manufacturer) %>%
summarize(mixmpg = mean(cty + hwy)) %>%
# create dummy var which reflects order when sorted alphabetically
mutate(ord =sprintf("%02i", as.integer(rank(mixmpg))) )
@xiaolai
xiaolai / jupyter-as-a-desktop-app.md
Last active September 15, 2023 08:37
Run Jupterlab as an desktop app

How to run Jupyterlab as a desktop app on Mac OSX

In Sep, 2021, Jupyterlab Desktop App (electron) was released by Mehmet Bektas (github repo).

brew install --cask jupyterlab

jupyterlab-app-first-opened

@charlesreid1
charlesreid1 / doit.sh
Last active March 28, 2024 06:07
Download the Large-scale CelebFaces Attributes (CelebA) Dataset from their Google Drive link
#!/bin/bash
#
# Download the Large-scale CelebFaces Attributes (CelebA) Dataset
# from their Google Drive link.
#
# CelebA: http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html
#
# Google Drive: https://drive.google.com/drive/folders/0B7EVK8r0v71pWEZsZE9oNnFzTm8
python3 get_drive_file.py 0B7EVK8r0v71pZjFTYXZWM3FlRnM celebA.zip
@pdanford
pdanford / README.md
Last active April 13, 2024 18:19
Launching iTerm2 from macOS Finder

Launching iTerm2 from macOS Finder

(Based on info from Peter Downs' gitub but with modified behavior to open a new terminal window for each invocation instead of reusing an already open window.)

The following three ways to launch an iTerm2 window from Finder have been tested on iTerm2 version 3+ running on macOS Mojave+.

pdanford - April 2020


@taniarascia
taniarascia / index.html
Last active April 3, 2024 21:05
HTML Skeleton file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<meta name="author" content="">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
@mrdwab
mrdwab / uReshape.R
Last active March 3, 2020 06:10
`reshape()` for "unbalanced" datasets.
uReshape <- function(data, id.vars, var.stubs, sep) {
# vectorized version of grep
vGrep <- Vectorize(grep, "pattern", SIMPLIFY = FALSE)
# Isolate the columns starting with the var.stubs
temp <- names(data)[names(data) %in% unlist(vGrep(var.stubs, names(data), value = TRUE))]
# Split the vector and reasemble into a data.frame
x <- do.call(rbind.data.frame, strsplit(temp, split = sep))
names(x) <- c("VAR", paste(".time", 1:(length(x)-1), sep = "_"))