Skip to content

Instantly share code, notes, and snippets.

View secantsquared's full-sized avatar
🤓

Ryan Boris secantsquared

🤓
View GitHub Profile
@secantsquared
secantsquared / vimcolor.sh
Created July 5, 2021 03:09 — forked from billycromb/vimcolor.sh
How to get rid of a different color border around vim in iTerm2
#!/bin/bash
# In iTerm, if you have a different colored terminal theme than what you use for
# vim. You'll see a border of whatever the background color is in fullscreen
# mode One way to get rid of this is to use escape sequences to switch to a
# different profilewhen you open vim, and back when you are done.
# for this to work you need to have a profile set up called 'vimcolors'
# that matches your vim colorscheme (or at least the background color)

Disclaimer: I'm not the original author of this sheet, but can't recall where I found it. If you know the author, please let me know so I give the attribution.

Note: Since this seems to be helpful to some people, I formatted it to improve readability of the original. Also, note that this is from 2016, many things may have changed, and I don't use macOS anymore, so I probably can't help in case of questions, but maybe someone else can.

Mac Network Commands Cheat Sheet

After writing up the presentation for MacSysAdmin in Sweden, I decided to go ahead and throw these into a quick cheat sheet for anyone who’d like to have them all in one place. Good luck out there, and stay salty.

Get an ip address for en0:

@secantsquared
secantsquared / events.py
Created November 1, 2020 18:23
click events in tkinter
import tkinter as tk
# Instantiate tkinter app
app = tk.Tk()
# Create example callback functions to use during click event
def leftclick(event):
print("left")
def middleclick(event):
@secantsquared
secantsquared / main.py
Last active October 21, 2020 06:45
2020-10-20-demo1.py
import csv
# create a holder list for each feature column
dates = []
assets = []
# handle file opening
with open('resources/budget_data.csv') as file:
@secantsquared
secantsquared / gradient.html
Created September 2, 2020 13:38
gradient svg/html house icon
<svg viewBox="0 0 16200 30200">
<defs>
<linearGradient id="myGradient" gradientTransform="rotate(90)">
<stop offset="5%" stop-color="gold" />
<stop offset="95%" stop-color="red" />
</linearGradient>
</defs>
<path
fill="url('#myGradient')"
d="M280.37 148.26L96 300.11V464a16 16 0 0 0 16 16l112.06-.29a16 16 0 0 0 15.92-16V368a16 16 0 0 1 16-16h64a16 16 0 0 1 16 16v95.64a16 16 00 0 16 16.05L464 480a16 16 0 0 0 16-16V300L295.67 148.26a12.19 12.19 0 0 0-15.3 0zM571.6
@secantsquared
secantsquared / timeitdecorator.py
Created July 10, 2020 00:17
simple decorator to approximate run time for basic functions
import time
from functools import wraps
def timeit(func):
@wraps(func)
def wrapper(*args, **kwargs):
t_initial = time.perf_counter()
value = func(*args, **kwargs)
t_final = time.perf_counter() - t_initial
@secantsquared
secantsquared / modtemplate.html
Last active April 28, 2020 04:29
modifiedtemp
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>
Financial Crime in Casinos in the Southwest Region of the U.S.
</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Bootstap -->
<link
@secantsquared
secantsquared / modifiedapp.py
Last active April 28, 2020 04:28
modifications
from flask import Flask, render_template
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = # This is the sqlite:///... connection string that you used to connect to the casino db
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db = SQLAlchemy(app)
@secantsquared
secantsquared / app.js
Created April 22, 2020 20:32
js stuff
// d3.json('static/samples.json').then(data => console.log(data))
function navBoxFunction() {
d3.json('static/samples.json').then(function (data) {
var select = d3.select('#selDataset')
var options = select
.selectAll('option')
.data(data.names)
.enter()
@secantsquared
secantsquared / api.py
Created April 21, 2020 00:45
funstuff
{
"coord": {
"lon": -79.42,
"lat": 43.7
},
"weather": [
{
"id": 804,
"main": "Clouds",
"description": "overcast clouds",