Skip to content

Instantly share code, notes, and snippets.

View chrisalbon's full-sized avatar

Chris Albon chrisalbon

View GitHub Profile
# -*- coding: utf-8 -*-
""" Deletes all tweets below a certain retweet threshold.
"""
import tweepy
from datetime import datetime
# Constants
CONSUMER_KEY = ''
<opml version="1.0">
<head>
<dateCreated>Mon, 21 Nov 2022 20:41:45 +0000</dateCreated>
</head>
<body>
<outline text="FastML" title="FastML" type="rss" xmlUrl="http://fastml.com/atom.xml" htmlUrl="http://fastml.com/"/>
<outline text="colah's blog" title="colah's blog" type="rss" xmlUrl="http://colah.github.io/rss" htmlUrl="http://colah.github.io/"/>
<outline text="Math ∩ Programming" title="Math ∩ Programming" type="rss" xmlUrl="https://jeremykun.com/feed/" htmlUrl="https://jeremykun.com"/>
<outline text="Pete Warden's blog" title="Pete Warden's blog" type="rss" xmlUrl="https://petewarden.com/feed/" htmlUrl="https://petewarden.com"/>
<outline text="Two Minute Papers" title="Two Minute Papers" type="rss" xmlUrl="https://www.youtube.com/feeds/videos.xml?channel_id=UCbfYPyITQ-7l4upoX8nvctg" htmlUrl="https://www.youtube.com/channel/UCbfYPyITQ-7l4upoX8nvctg"/>
@chrisalbon
chrisalbon / gist:d3fb732e97cfb2e06c65f7a84e2b4fe2
Last active May 29, 2023 20:11
Quick And Dirty GPU Speed Test
"""
This module imports necessary libraries from PyTorch, torchvision, and sets up the device configuration for CUDA if available.
It then sets hyperparameters for an application of a fully connected neural network on the MNIST dataset of handwritten digits.
The MNIST dataset is loaded, transformed into tensors, and split into a training and a test dataset.
The fully connected neural network architecture is defined with one hidden layer, after which the model is initiated.
CrossEntropyLoss is used as the loss function, and Adam optimizer is used for optimization.
Training is done for the specified number of epochs, where for each epoch, forward pass is performed, loss is calculated,
backpropagation is applied, and the model parameters are updated.
@chrisalbon
chrisalbon / main.py
Last active July 5, 2023 00:23
Three Legged Auth To Tweet Something
import tweepy
from dotenv import load_dotenv
import os
# Constants
load_dotenv()
#Secrets
CONSUMER_KEY = os.getenv("CONSUMER_KEY")
CONSUMER_SECRET = os.getenv("CONSUMER_SECRET")
<?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/"/>
@chrisalbon
chrisalbon / gist:9affdbe840ac0a30fd5d0faa63169eb0
Created March 2, 2024 19:18
VSCode Terminal <-> File keyboard shortcut
// Place your key bindings in this file to override the defaults
[
// Toggle between terminal and editor focus
{
"key": "ctrl+`",
"command": "workbench.action.terminal.focus"
},
{
"key": "ctrl+`",
"command": "workbench.action.focusActiveEditorGroup",