Skip to content

Instantly share code, notes, and snippets.

View jxmorris12's full-sized avatar
🐳
just chilling

Jack Morris jxmorris12

🐳
just chilling
View GitHub Profile
@jxmorris12
jxmorris12 / git-fatfiles
Created October 4, 2019 19:58
print large stuff in your git repo
git rev-list --all --objects | \
sed -n $(git rev-list --objects --all | \
cut -f1 -d' ' | \
git cat-file --batch-check | \
grep blob | \
sort -n -k 3 | \
tail -n40 | \
while read hash type size; do
echo -n "-e s/$hash/$size/p ";
done) | \
@jxmorris12
jxmorris12 / stdc++.h
Created October 2, 2019 21:22
stdc++.h for Mac OSX (/usr/local/include/bits/stdc++.h)
// C++ includes used for precompiling -*- C++ -*-
// Copyright (C) 2003-2013 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
@jxmorris12
jxmorris12 / Makefile
Created September 5, 2019 14:51
compiles xv6 with Mac OS X qemu and cross-compiler i386-elf-gcc-gdb
OBJS = \
bio.o\
console.o\
exec.o\
file.o\
fs.o\
ide.o\
ioapic.o\
kalloc.o\
kbd.o\
@jxmorris12
jxmorris12 / deep work script
Created August 4, 2019 21:50
a script to force productivity during deep work time
#!/usr/local/bin/python3
#
# written 8/2/19 by jxm
#
# For some reason Chrome has its own DNS cache that makes websites
# still accessible sometimes after DNS is enabled. I considered adding
# code in this script to force-restart Chrome, but I'm going to forgo
# that for now until I find a better way to edit Chrome's settings
# to disable DNS caching. (Or just use Firefox...)
#
@jxmorris12
jxmorris12 / copy_images.py
Created April 5, 2019 13:01
Copy all pictures from iMessage on Mac to current folder
# needs python 3.5+
import glob
import os
def sh_escape(s):
return s.replace("(", "\\(").replace(")","\\)").replace(" ","\\ ")
home = '/Users/myusername'
glob_path = home + '/Library/Messages/Attachments/**/*'
@jxmorris12
jxmorris12 / server.js
Created September 25, 2016 16:12
ExpressJS static web server
#!/bin/env node
// Jack Morris 06/26/16
var express = require('express');
var fs = require('fs');
var App = function() {
// Scope.
var self = this;