Skip to content

Instantly share code, notes, and snippets.

View 4justinstewart's full-sized avatar

Justin Stewart 4justinstewart

View GitHub Profile
@4justinstewart
4justinstewart / users_without_customers.csv
Created January 16, 2025 23:41
Users with Paid Status but w/o Customer objects
user_id email status subscription_id remaining_credits start_date
262213 [email protected] 2 914 600.0 2024-12-27T18:41:23.151667+00:00
262593 [email protected] 2 915 600.0 2024-12-27T18:41:23.413359+00:00
262314 [email protected] 2 916 600.0 2024-12-27T18:41:23.681111+00:00
44 dsadas 2 917 3241.0 2024-12-27T18:41:23.945863+00:00
47 [email protected] 2 918 3240.0 2024-12-27T18:41:24.210118+00:00
55 [email protected] 2 919 3240.0 2024-12-27T18:41:24.474193+00:00
45 [email protected] 1 920 1410.0 2024-12-27T18:41:24.739826+00:00
61 [email protected] 2 921 3240.0 2024-12-27T18:41:25.004005+00:00
64 [email protected] 2 922 3240.0 2024-12-27T18:41:25.265060+00:00
@4justinstewart
4justinstewart / git-purge-branches.sh
Last active November 9, 2021 16:13 — forked from toland/git-purge-branches.sh
Simple shell script to clean up stale feature branches
#!/bin/sh
# Modified version of script found at
# http://devblog.springest.com/a-script-to-remove-old-git-branches
# This has to be run from main
git checkout main
# Update our list of remotes
git fetch origin
git remote prune origin
@4justinstewart
4justinstewart / learn_web_app_development.md
Last active June 20, 2019 20:47
A list of resources that allow you to dip your feet in web application development, figure out if it's right for you and cross the finish line into legitimately making money with this skill.
@4justinstewart
4justinstewart / js-tricky-bits.md
Created December 8, 2017 20:25 — forked from amysimmons/js-tricky-bits.md
Understanding closures, callbacks and promises in JavaScript

#Understanding closures, callbacks and promises

For a code newbie like myself, callbacks, closures and promises are scary JavaScript concepts.

10 months into my full-time dev career, and I would struggle to explain these words to a peer.

So I decided it was time to face my fears, and try to get my head around each concept.

Here are the notes from my initial reading. I'll continue to refine them as my understanding improves.

@4justinstewart
4justinstewart / gist:5d34a033168fb1aafebb
Created July 15, 2015 17:19
Find Unknown DB object by UUID
def find_unknown_object(uuid_string)
db_connection = ActiveRecord::Base.connection
db_connection.tables.each do |table_string|
begin
model = table_string.classify.constantize
object = model.find(uuid)
return object unless object.nil?
@4justinstewart
4justinstewart / jquery_example.html
Created March 15, 2014 15:31 — forked from dbc-challenges/jquery_example.html
Intro to jQuery for Phase 0
<!DOCTYPE html>
<html>
<head>
<title>DOM manipulation with jQuery</title>
<!-- Add a link to jQuery CDN here script here -->
<script type="text/javascript" src="jquery_example.js"></script>
</head>
<body>
@4justinstewart
4justinstewart / boggle_board.rb
Last active August 29, 2015 13:56 — forked from dbc-challenges/0.2.1-boggle_class_from_methods.rb
phase 0 unit 2 week 1 boggle class challenge
class BoggleBoard
attr_reader :board
def initialize(board_name = create_board)
@board = board_name
end
def create_word(*coords)
coords.map { |coord| board[coord.first][coord.last] }.join
@4justinstewart
4justinstewart / 0.2.1-boggle_class_from_methods.rb
Last active January 2, 2016 20:39 — forked from dbc-challenges/0.2.1-boggle_class_from_methods.rb
Uses classes to create a retrieve Boggle word from a Boggle Board
# INITIAL CODE
class BoggleBoard
attr_reader :board_type
def initialize(board_type)
@board_type = board_type
end
def create_word(*coords)
coords.map { |coord| @board_type[coord.first][coord.last]}.join("")