Skip to content

Instantly share code, notes, and snippets.

View cjgunnar's full-sized avatar

cjgunnar cjgunnar

View GitHub Profile
@cjgunnar
cjgunnar / colab_print_demo.ipynb
Last active April 14, 2023 17:55
A Colab cell that will generate a nicely formatted PDF of a Colab notebook in your Google Drive.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cjgunnar
cjgunnar / Chart.js
Created January 5, 2022 01:14
A basic, size-responsive, interactive React plot created with the excellent Plotly library
import Plotly from 'plotly.js-cartesian-dist';
import { useEffect, useMemo, useState } from 'react';
import createPlotlyComponent from 'react-plotly.js/factory';
// use only portion of plotly library necessary
const Plot = createPlotlyComponent(Plotly);
/**
* a simple plot with x and y axis, will completely fill div it's placed in
@cjgunnar
cjgunnar / example.kt
Last active May 10, 2020 22:44
kotlin processing file and image
fun main() {
//to read a file
val scan = Scanner(FileReader("pathToFile"))
//...
PApplet.main("ImagePApplet")
}
@cjgunnar
cjgunnar / bot.py
Created July 14, 2019 04:29
Timecheck bot source code (token hidden)
'''
Timecheck Discord Bot
Reminds those in the list to get on at 2:35, then 2:40
Only works with Python 3.6 as of 4/2/2019
'''
# IMPORTS
import time, datetime, pytz, asyncio
asyncio
import discord
@cjgunnar
cjgunnar / MatrixBot.java
Last active July 2, 2019 23:06
MatrixBot - Less sketchy than HalBot
package PokerBots;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.nio.charset.StandardCharsets;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collections;
@cjgunnar
cjgunnar / GameBoard.java
Created May 29, 2019 22:56
Move a dot around the screen over an image
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.image.ImageObserver;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;