Skip to content

Instantly share code, notes, and snippets.

@shanecandoit
shanecandoit / snap_shot_dates.ipynb
Last active March 1, 2023 21:31
last_24_snapshot_dates
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="">
@shanecandoit
shanecandoit / ast_to_json.ipynb
Created October 1, 2022 03:59
read some python code, turn it into an ast, into json, then ...
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shanecandoit
shanecandoit / gist:6c3009fa374e15aba9d330a08db16f53
Created July 31, 2021 04:04
icecream-parlor: Given a list of prices for the flavors of ice cream, select the two that will cost all of the money they have.
import java.util.*;
class Scratch {
public static void main(String[] args) {
// https://www.hackerrank.com/challenges/icecream-parlor/problem
// solved!
// Given a list of prices for the flavors of ice cream,
// select the two that will cost all of the money they have.
int m;
from PyPDF2 import PdfFileWriter, PdfFileReader
# https://stackoverflow.com/questions/490195/split-a-multi-page-pdf-file-into-multiple-pdf-files-with-python#490203
def pdf_split(fname, start, end=None):
print('pdf_split', fname, start, end)
# pdf_split ~/Downloads/4-27-files/Invoice Email-0.pdf 1 4
#inputpdf = PdfFileReader(open("document.pdf", "rb"))
inputpdf = PdfFileReader(open(fname, "rb"))
free -m | awk '{if (NR==2) {print $3" / "$2" = "$3/$2}}'
# 61 / 483 = 0.126294
@shanecandoit
shanecandoit / coursera-python-machine-learning-module-1-knn.ipynb
Created January 17, 2020 19:19
coursera-python-machine-learning-module-1-knn
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.