Skip to content

Instantly share code, notes, and snippets.

@thefotes
thefotes / README.md
Created December 9, 2025 20:14
Professional Placeholder Image Generator - Python script to generate placeholder images with profile photos, names, titles, and company logos

Placeholder Image Generator

Generate professional placeholder images with profile photos, names, titles, and company logos.

Installation

pip install -r requirements.txt
@thefotes
thefotes / data.rmd
Created May 23, 2025 11:37
NYPD Incident Data - Data Science as a Field - Final Project
---
title: "NYPD Shooting Incidents"
author: "P. Foti"
date: "2025-05-13"
output:
pdf_document: default
html_document: default
---
# Introduction
@thefotes
thefotes / xop.sh
Created February 23, 2020 19:28
Opens either xcodeproj or xcworkspace in CWD
#!/bin/bash
set -e
xcodeproj=`find . -maxdepth 1 -name "*.xcodeproj"`
proj_name=`echo $xcodeproj | sed 's/.\///g' | sed 's/.xcodeproj//g'`
xcworkspace=`find . -maxdepth 1 -name "$proj_name.xcworkspace"`
if [[ ! -z $xcworkspace && -e $xcworkspace ]]; then
open $xcworkspace
@thefotes
thefotes / iterator.py
Created September 19, 2017 14:50
Lambda function for iterating over a set of items as part of a step function.
#!/usr/bin/env python3
def lambda_handler(event, context):
iterator = event['iterator']
index = iterator['index']
step = iterator['step']
count = iterator['count']
items = iterator['items']
index += step
@thefotes
thefotes / configure_Iterator.py
Created September 19, 2017 14:49
Lambda function for configuring a step function iterator.
#!/usr/bin/env python3
def lambda_handler(event, context):
count = len(event['input_data']['items'])
index = -1
step = 1
items = event['input_data']['items']
return {'index': index, 'count': count, 'step': step, 'items': items}
import Foundation
protocol PJPageControlUsable {
var indicatorType: PJPageControl.Indicator { get }
}
protocol PJPageControlDelegate: class {
//
// PJNotificationCenter.m
// NotificationSample
//
// Created by Peter Foti on 6/21/16.
// Copyright © 2016 Peter Foti. All rights reserved.
//
#import "PJNotificationCenter.h"
#import "PJNotificationKey.h"
@thefotes
thefotes / ow.sh
Created January 25, 2016 18:46
Checks current directory for either .xcworkspace or .xcodeproj, if it finds xcworkspace opens that, otherwise opens xcodeproj
#!/bin/bash
set -e
xcodeproj=`find . -maxdepth 1 -name "*.xcodeproj"`
proj_name=`echo $xcodeproj | sed 's/.\///g' | sed 's/.xcodeproj//g'`
xcworkspace=`find . -maxdepth 1 -name "$proj_name.xcworkspace"`
if [[ ! -z $xcworkspace && -e $xcworkspace ]]; then
open $xcworkspace
@thefotes
thefotes / localized.swift
Created January 17, 2016 13:33
Cleaner localized strings with Swift protocols and enums.
import Foundation
// Localized string struct that has single static method which accepts a `Localizeable` value.
struct LocalizedString {
// Usage: LocalizedString.localizedStringForValue(NavBarTitle.Home)
static func localizedStringForValue<T: Localizeable>(localizeableValue: T) -> String {
return NSLocalizedString(localizeableValue.localizedString, comment: localizeableValue.localizedStringComment)
@thefotes
thefotes / dupeImports.sh
Created June 28, 2015 19:11
Given a path to an Xcode project, loops through all files and checks to see if any files have been imported more than once in the same file.
#!/bin/bash
set -e
read -e -p "Enter path to Xcode project: " FILES
eval FILES=$FILES
find "$FILES" -type f \( -name "*.h" -or -name "*.m" \) | while read -r f;
do