Skip to content

Instantly share code, notes, and snippets.

View codejake's full-sized avatar

Jake Shaw codejake

View GitHub Profile

Agency is your ability to shape circumstances instead of being shaped by them.

Most people live their entire lives as spectators. They watch others build companies, create movements, and change history. They attribute success to luck, timing, or privilege. This is a comforting illusion that protects their ego.

The truth is simpler and harder to accept: agency is a choice.

Every billionaire, world-changer, and history-maker made this choice. They decided they wouldn't accept the world as given. They would bend reality instead. This isn't mystical — it's mechanical. You either believe your actions matter or you don't.

The education system trains this out of us deliberately. It rewards compliance and punishes initiative. School teaches you to ask for permission. Life rewards those who act without it.

// This sucks. I'm probably doing it wrong. Please flame me.
import Foundation
enum FileSearchError: Error {
case fileNotFound
case readError(String)
}
/// Searches a file for lines containing a specific string and prints matching lines
@codejake
codejake / gist:2c172b6c44bab82541b9fb596f4b0f69
Last active September 8, 2024 21:23
What is the difference between a detection engineering versus a traditional SOC security model, according to Claude?

A detection engineering security model differs from a traditional Security Operations Center (SOC) approach in several key ways:

  1. Proactive vs. Reactive:
  • Detection Engineering: More proactive, focusing on developing and refining detection capabilities before incidents occur.
  • Traditional SOC: Often more reactive, responding to alerts and incidents as they happen.
  1. Focus on Engineering:
  • Detection Engineering: Emphasizes creating custom detection rules, algorithms, and data analysis techniques.
  • Traditional SOC: Typically relies more on out-of-the-box solutions and predefined alert rules.

Why I Stopped Being A Leftist

Or any-ist for that matter

Author: Gurwinder Bhogal

Date: June 10, 2022

In the summer of 2013 I’m in the town of Luton, England, researching the terrorist network, al-Muhajiroun. While scouting the area, I see a stall at which known al-Muhajiroun members are handing out leaflets. Seeing an opportunity to gain valuable information on the group, I approach them.

One of the jihadists introduces himself, and hands me a leaflet detailing Assad’s war crimes against Sunni Muslims in Syria. He asks if I’m Muslim and, in order to not be dismissed by him, I claim I am. We get talking about Syria, and I nod in feigned agreement. But the more he talks, the more he gets the facts wrong, and I begin to develop an uncontrollable urge to correct him. When he says “The West has never helped our brothers and sisters when we needed it,” the urge within me becomes overwhelming, and I blurt out, “What about Kosovo? NATO saved many Muslims there.” The jihadist glares at me. Then his ey

@codejake
codejake / read-csv.py
Created April 24, 2024 15:15
Here you go. This Python script reads a CSV file. If you need additional learnin', get in touch.
#!/usr/bin/env python3
# Sample Python script for noobs. This script will run on just about any
# Python 3 install without additional software installation required.
import csv
# Specify the path to your CSV file
file_path = 'data.csv'

Using pipx

pipx is a tool for installing and running Python applications in isolated environments. It's especially useful for Python-based tools and scripts that are intended to be run from the command line, rather than imported into other Python code. By using pipx, you can install applications and their dependencies in isolated environments, avoiding conflicts between packages and ensuring that each application has the specific versions of libraries it requires.

Installation

macOS

Install using brew install pipx or manually, using: python -m pip install --user pipx.

Afterwards, run pipx ensurepath to ensure that pipx in is your PATH.

#!/usr/bin/env python3
# A simple script that checks the current directory for a github remote
# and if found, opens the remote repo in a browser window.
# Works on macOS, at least. Can be adapted for Windows & Linux.
import subprocess
import sys
try:
// Terrible Swift code generated by the llama LLM model.
import Foundation
let osVersion = ProcessInfo.processInfo().operatingSystemVersion as String
print("Your operating system is (osVersion)n")
let deviceSerialNumber = ProcessInfo.processInfo().deviceId as String
print("Your device identifier is (deviceSerialNumber)n")
let urlString = "https://foo.org/submit"
guard let url = URL(string: urlString), !url.isFileURL else { return }
let request = NSMutableURLRequest(url: url, cachePolicy: .reloadIgnoringCacheData)
@codejake
codejake / use-a-conf.py
Created June 24, 2022 16:07
Using a conf file with Python basic example
#!/usr/bin/env python3
# my.conf:
# [DEFAULT]
# my_user = [email protected]
# my_pass = s3cr3t
import configparser
config = configparser.ConfigParser()
from queue import Queue
from threading import Thread
from time import sleep
from rich.live import Live
from rich.panel import Panel
from rich.progress import Progress, SpinnerColumn, BarColumn, TextColumn
from rich.table import Table as rcTable
from rich.console import Console
from rich.spinner import Spinner, SPINNERS
from rich.status import Status