Skip to content

Instantly share code, notes, and snippets.

View NathanLawrence's full-sized avatar

Nathan Lawrence NathanLawrence

View GitHub Profile
@NathanLawrence
NathanLawrence / setup_info.sh
Created November 4, 2020 16:09
Quick iOS Dev Setup Dump
#! /bin/bash
echo "*System Version*"
system_profiler SPSoftwareDataType | grep -o -E -e 'macOS[^\n]+'
echo -e "\n*Xcode Info*"
xcodebuild -version
echo -e "\n*Active Simulators*"
xcrun simctl list devices 'booted' | grep -o -E -e '(iPad|iPhone).+?$'
//
// NSPredicate.swift
// Nighthawk
//
// Created by Nathan Lawrence on 8/3/19.
// Copyright © 2019 Nathan Lawrence. All rights reserved.
//
import Foundation
<p data-pym-src="https://www.path.to/the/thing/you/uploaded.html">Loading...</p><script type="text/javascript" src="https://pym.nprapps.org/pym-loader.v1.min.js"></script>
// ==UserScript==
// @name Fix Core Publisher Printing Styles
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Make it so Core Publisher actually prints acceptably.
// @author Nathan Lawrence
// @match *://www.kbia.org/*
// @grant none
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==
@NathanLawrence
NathanLawrence / index.html
Created January 25, 2018 23:41
Multi-Ring Synchronized Value Pie
<!DOCTYPE html>
<meta charset="utf-8">
<div id="chart"></div>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script>
var data = [
{name: "USA", value: 40, secondary_value: 37, tertiary_value: 12},
{name: "UK", value: 20, secondary_value: 96, tertiary_value: 16},
@NathanLawrence
NathanLawrence / feeling-lucky.py
Created August 24, 2017 14:06
Put First Google Result in a New CSV Next to Old CSV Full of Search Terms
import os
import csv
from tqdm import tqdm
from google import search
file_name = "blah.csv"
output_file_name = "out.csv"
input_file = csv.DictReader(open(file_name, 'rU'), dialect='excel')
out_file = csv.DictWriter(open(output_file_name, 'w'), fieldnames=['query', 'result_url'])
@NathanLawrence
NathanLawrence / models.py
Created April 14, 2017 15:27
Access Missouri Existing DB Models (PeeWee)
from peewee import *
database = PostgresqlDatabase('accessmo', **{'host': '*************',
'password': '**********', 'user': '************', 'port': 5432})
# Initialize Deferred Relationships
DeferredSession = DeferredRelation()
DeferredLegislator = DeferredRelation()
DeferredLegislatorTwo = DeferredRelation()
DeferredMecCommittee = DeferredRelation()
@NathanLawrence
NathanLawrence / cp-topic-embed-tweak.html
Created November 10, 2016 14:03
Core Publisher Full Width Topic Page Script Code
<script type="text/javascript" src="http://apps.nathanlawrence.org.s3.amazonaws.com/cp-tweaks/cp-topic-full-width.js"></script>

Nathan's Netflix Recommendations