Installing Laravel Spark Manually with Composer – 2021

For whatever reason, you may need to install the new Laravel Spark into your project without following their installation instructions. Sometimes you don’t control the server environment as much or devops, etc so it’s just easier to include the files in your project. Here’s how to tell Composer where the files are and how to load Spark.

First – Update composer.json

Similarly to the official install docs, you need to add a snippet to your composer.json file.

"repositories": [
   {
     "type": "path",
     "url": "./spark-stripe"
   }
],

In my case, I have a folder in the root of my project called spark-stripe in which I placed all of the package files. Does it matter what the name is? I don’t know but since that is the package name, it made the most sense to me.

Final – Install the Package

Lastly, you’ll need to install the package like you normally would. For what it’s worth, I’m using Composer v2.

composer require laravel/spark-stripe 

If you don’t see a new list of dependency packages being installed, you likely did something wrong. Go back and check your composer.json file for spelling errors or other mistakes.

Hope this helps you out!

How to add a Macro to the Laravel HTTP client facade

While working on Let Them Eat 🍰I came across some peculiar behavior. For some of the Slack web API’s, there is a requirement to send the requests as a URL encoded form object. Since all of their API endpoints support this method of access, I created a little helper on my user object to get an instance of the Laravel HTTP client, with the asForm() method already applied.

This was working great until today when I wanted to add support for blocks to one of my bot responses. While I could support sending that field as a JSON string, it felt better to change the request to be sent fully as JSON instead. I thought, that would be as simple as calling ->withHeaders() again, but unfortunately, the deep-recursive-merge used by the HTTP facade doesn’t clear out any existing values.

Http::asForm()->asJson()

"headers" => [
  "Content-Type" => [
    0 => "application/x-www-form-urlencoded",
    1 => "application/json"
  ]
]

Obviously, the best option would be to not call the facade with multiple methods that change the same object, but in this case I really wanted to just overwrite it for this one instance.

Enter, Macros!

There are lots of places online to read about Laravel Macros so I won’t go into it here too deeply, but the gist of it, is you can add custom methods to core objects without extending them and creating new classes. This can be super helpful when you just want to add a little helper method but don’t want to go through the process of extending the class the old-fashion way. This can be especially useful to access protected properties or private methods.

I knew all facades in Laravel are macroable so I jumped into my AppServiceProvider boot method and added a lil somthin somethin.

// within AppServiceProvider::boot()
PendingRequest::macro('clearContentType', function () {
  $this->options['headers']['Content-Type'] = [];
  return $this;
});

Originally, I tried to add the Macro directly to the Http facade, but that only ended up working if I called the new method statically. To have it work in the manner I expected, I had to add the macro to Illuminate\Http\Client\PendingRequest, which is the class that is bound to the Http facade under the hood.

Using my new macro, I can easily clear out any content type headers before making a request, no matter how many times I call methods that set the content type header.

Http::asForm()->asJson()->asForm()->asJson()->asForm()->clearContentType()->asJson()

"headers" => [
  "Content-Type" => [
    0 => "application/json"
  ]
]

Now, I suspect this is a bug, but I’m not sure. I’ll be opening an issue on Github and we shall see. In the meantime, the macro will have to do! 🙂

Running Multiple CLI Commands in One Terminal for Laravel Development

While working on Let Them Eat Cake 🍰 , I noticed when I was end-to-end testing the app locally, I need a few different things running at once:

  • Laravel Queue Worker – running queued jobs
  • Expose – Proxy for allowing external webhooks needed for my app
  • Stripe CLI – Passing Stripe webhooks to my app without using a proxy
  • Laravel Mix – Bundling static assets

Running each of these commands separately isn’t that big of a deal, but it can be a hassle to remember to start them all. This was very apparent yesterday as my computer decided it wanted to reboot every time it went to sleep! A short trip around town running errands with my wife and my computer restarted 3 times in a couple of hours; frustrating!

Today I decided to look into some potential solutions. I had a few basic requirements while I was looking around.

  1. It needs to be easy to start and modify for each new project – this also implies some flexibility. No sudo password required nonsense.
  2. I can stop all running processes with SIGINT (CTRL+C)
  3. All process output is still visible so I can see compile errors or bad requests.
  4. Process output is in one terminal window/tab (optional – but I wanted it!)

A little searching and some testing later and I think I’ve come to a nice solution that gives me plenty of control and flexibility.

One of the first tools I discovered was moreutils, a package you can install with brew that essentially adds a handful of helpful CLI utilities. The name is play on coreutils, a set of packages included in most Linux distros. Specifically, there is a package called parallels that seemed to be just what I was looking for. It has lots of extra features and can start lots of parallel processes and close them all at once. The reason I ultimately chose not to go this route, was in case I work on any of my projects with other developers. Given the simplicity of my use case compared to the feature set of the package, it was honestly overkill. This also means my project is that much more portable between machines and developers. I keep my own dotfiles, but if I can avoid complexity, I like to try that route first. 🙂

The Solution

Ultimately, I settled on a little shell script courtesy of this Ask Ubuntu thread. Here is my adaptation:

#!/bin/bash
sh ./startexpose &
P1=$!
php artisan queue:listen &
P2=$!
stripe listen --forward-to eat-cake.test/stripe/webhook &
P3=$!
wait $P1 $P2 $P3

A quick rundown. The first process is essentially another wrapper with some Expose configuration details. The output from this is a big tail-ing table of incoming requests. The second is my queue worker. I opt for queue:listen here so the worker will automatically restart itself when any code in my application changes. Output from this command is a line for every queued job that is processed. Third is the Stripe CLI, which needs to be configured beforehand, but is a once every 90 day thing. Seeing as it has access to my payment data, I’m okay with the hassle tradeoff.

I’m still debating on whether or not to include my Laravel Mix watch command in this, and I might add a runtime flag for it, but without trying it for any reasonable length of time yet, I’m guessing I’ll need to start/stop the watcher to do production compiles more often than anything else. The other commands can run mostly unmonitored unless I need to check something, but I tend to get a lot more feedback when I inevitably screw up the closing brackets in a JS file. 😬

Hope this helps you out! Feel free to ask any questions here or send me a tweet @DaronSpence. ✌️

Migrating Data and Merging Models in Laravel

On one of my side projects, Let Them Eat 🍰 , I recently needed to do some migrations to combine / merge two models. I originally had optimized a bit too much, and later realized things would be a lot simpler if I only had one model.

There wasn’t a ton of info about this online, so I’m going to do my best to try and explain what I did. For this migration, I was using Laravel 8.

So turns out, merging models is kind of a pain! In my case, I was merging a SlackUser::class model with the default User::class model that ships with Laravel. From a data perspective, it wasn’t too bad. I needed to add a few columns to the User table that were previously on the SlackUser table. The issues arose when I realized there were a lot of places in my code that were reliant on accessing each model off of a relationship of the other. So lots of calls to $user->slackUser and $slackUser->user intermingled across the app, dependent on what I was doing at the time.

Since my ultimate goal was to completely delete any reference to a SlackUser, I had to take a careful approach when modifying the database.

First, I added the extra columns I needed to the users table.

Schema::table('users', function (Blueprint $table) {
  $table->string('slack_user_id')->after('id')->nullable();
  $table->foreignId('team_id')->after('slack_user_id')->nullable()->constrained()->onDelete('cascade');
  $table->boolean('is_owner')->after('team_id')->default(false);
  $table->string('avatar_url')->after('email')->nullable();
  $table->string('timezone')->after('avatar_url')->nullable();
  $table->boolean('is_onboarded')->after('timezone')->default(false);
  $table->softDeletes();
});

I continued in much the same process for other tables that needed to be modified.

After the tables were modified, I queried all of the SlackUsers and looped over them to create new User models if they didn’t have one already. In my app, a User model was only created if the person logged into the webapp, otherwise they would happily live on as only a SlackUser. Now, everyone gets a user model, and I don’t really care if they log in or not!

Some advice on the Shifty Coders Slack recommended not to rely on Eloquent here. This makes sense as in a future release, I’ll be completely removing the SlackUser model, so if I relied on Eloquent for the migration, it would throw an error if I ever deleted that class. Here’s what the migration looked like:

DB::table('slack_users')->get()->map(
	function ($slackUser) {
		$userId = $slackUser->user_id;
		$slackUser = Arr::except((array) $slackUser, ['id', 'created_at', 'updated_at', 'user_id']);
		$user = User::findOrNew($userId);
		if (!$user->exists) {
			$user->name = $slackUser['slack_user_id'];
			$user->password = Hash::make(random_bytes(20));
		}
		$user->fill($slackUser);
		$user->save();
	}
);

This is all pretty straightforward. For each SlackUser, check if they have a User model already, and if not, create a new User and give them a random password. My app doesn’t actually use passwords for authentication, instead relying solely on Slack Oauth, so the password field is irrelevant. In the future I may want to allow for other auth methods, so I left it for the sake of simplicity.

After all of the users were migrated, I could then go about the business of updating other models that used the SlackUser as a foreign key. In my case, I had messed up in the original migrations and not enforced those foreign keys, but if they are enforced in your app, you’ll need to drop the foreign key before you go about migrating all of this data around.

$table->dropForeign(['slack_user_id']);

Here is what the migration to change the foreign keys on my Cake model looked like.

DB::table('cakes')->get()->map(
	function ($cake) {
		$giver = DB::table('slack_users')->select('slack_user_id')->where('id', '=', $cake->giver_id)->get()->first();
		$giver = User::where('slack_user_id', '=', $giver->slack_user_id)->withTrashed()->first();
		$target = DB::table('slack_users')->select('slack_user_id')->where('id', '=', $cake->target_id)->get()->first();
		$target = User::where('slack_user_id', '=', $target->slack_user_id)->withTrashed()->first();
		DB::table('cakes')->where('id', $cake->id)->update(['giver_id' => $giver->id, 'target_id' => $target->id]);
	}
);

Again, notice that I’m not using Eloquent to access the SlackUser model, instead relying on the DB:class facade. I’m free to delete the SlackUser::class at anytime now!

All of this code was added to the up() method of my migration, and I carefully reversed all of the column changes for the down() method. One thing I did not do in the down method, was remigrate any data. I figured if the deploy went so bad that I needed to do that, then I would be better off restoring the database entirely from a backup instead. The down() changes I made were purely so I could migrate up/down for tests, which weren’t reliant on any database values anyway.

That brings me to another pain point: tests! 90% of my tests had to be updated since they mostly relied on the SlackUser. I started with one test file at a time, running the entire file first, then each failing test. I generally changed any instance of SlackUser to User first and then saw what broke. The first few were painful as there were references to relationships that needed to be updated. Often times while doing this, I would catch something that needed to be updated in my migration as well.

Eventually, most of the methods from SlackUser were migrated to User and all of the relationships were updated. Views were the last thing to be checked and I even managed to add a few missing tests based on failures I found while manually browsing the site locally.

// One of my newly added tests!
/** @test */
public function a_user_can_view_the_perk_redemption_page() //phpcs:ignore
{
	$this->withoutExceptionHandling();
	$user = factory(User::class)->create([
	  'is_owner' => true
	]);

	// Make fake users for the manager selection.
	factory(User::class, 5)->create([
	  'team_id' => $user->team->id
	]);

	$this->actingAs($user);

	$user->team->perks()->create([
	  'title' => 'an image perk',
	  'cost' => 100,
	  'image_url' => 'https://perk-image.com/perk.jpg'
	]);

	$this->assertCount(1, Perk::all());

	$res = $this->get(route('redeem-perk-create', Perk::first()));
	$res->assertOk();

	// Check for all of the names on the page. (manager selection for perk redemption)
	$res->assertSee([...User::all()->map->name]);
}

In the end, the Github PR had 57 changed files! A huge undertaking by any standard. I would venture a guess that those 57 files represent 80-90% of all of the code I had written for the app.

Overall, I’m happy I did this, as the logic surrounding users is much simpler to understand. I also got the opportunity to try out some new things and learn a bit more about the built in DB facade. I’m still kinda intimidated by SQL in general, but I’m getting more courageous every time I tackle one of these projects. Backups are still really important though! 😉

Conclusion

If you have any questions, feel free to reach out to me on Twitter or leave a comment!

January Update Pt 2: Fasting Boogaloo

Well, here we are a week later and I have to admit I feel better. I’ve overloaded on fasting propaganda from across the internet, though primarily YouTube and Reddit.

I’ve gone back and listened to a few lectures by Dr. Jason Fung. His “The Aetiology of Obesity” series has been my sleeping playlist for a few nights now. It’s a 6 part lecture series, each lecture running about an hour, discussing theories on why humans become obese and the different factors that can contribute. Overall just interesting stuff, plus he has a pleasant voice (IMO) and he’s very easy to digest (heh).

Practically, not much has changed re: my diet compared to earlier fasting cycles. Tuesday, I broke a 44~ hour fast with a burger patty topped with a fried egg, a half pound of salad with strawberries, feta, walnuts, and a few spoonfuls of a ranch-like dressing. I followed that up with some popcorn and a few slices of bacon.

Last night I ate again, this time getting lured into a chicken bowl with cauliflower rice from Chipotle. I walked over there and back home, proceeding to pile the contents of my bowl onto some low carb tortillas I already had at home. I followed that up with the rest of the strawberries, some more popcorn, and 3-4oz of pistachios. I drank 3 cans of sparkling water with dinner and by 9pm, I felt pretty full so decided to start my fasting timer an hour early.

Now I begin another 40+ hours until dinner on Friday evening. Sleep has been pretty meh, but that’s to be expected while fasting. I was tired earlier and managed to be in bed by 11pm, which is rare for me. I woke up around 6~ this morning and got out of bed around 7:30 to get some coffee and write this post.

I have a therapy appointment this afternoon, the second with my new therapist, and I’m tentatively looking forward to it. If the weather isn’t too bad I might try and walk over there.

Overall, this week has been a step in the right direction and I’m optimistic it will continue to trend in that way.

One thing I do want is to find some more fasting support from local friends. I don’t know what we’d talk about but it feels intuitively easier to stick with something when there is accountability, even if it’s unspoken.

My dad is kinda doing IF right now with his church’s new year resolution/diet/fast. He’s had good results so far but I’m not sure how he feels about continuing it after his church finishes the fasting period. I’ll text him later today and see how things are going.

As always, feel free to tweet me @daronspence or leave a comment if you have questions.

✌️

Back on the horse, maybe? January 2021

Fuck, 2020 felt like a dumpster fire to a lot of people in the world, and that means me too!

Note: please excuse me if it feels like I’m rambling. It’s late and I’m typing this on a keyboard I’m not really used to so it takes longer to get my thoughts out with extra editing.

I’m just so disappointed in myself. I know it’s late as of the time of this writing, but I think that might just point towards something I feel is true. I know what I need to do, but overcoming that split second instinct to run towards the comfortable is obviously hard to ignore.

Just now, I thought it might be a good idea to go to Whataburger just to get some unsweet tea, since they’re the only place open late with anything close to fresh tea. But I know I’ll be tempted to order something else in that drive thru line. It’s too easy and I’m looking for any excuse.

In 2019, my wife bought me a coat on a random trip to the mall. It’s a very nice peacoat that cost her a lot of money, but she knew how much I missed my old one and she figured I deserved it for whatever reason. I really like it and I got a lot of compliments on how good I looked when I wore it out and about, especially with people I had not seen in a year or two.

It finally got cold enough this past month to warrant wearing a coat outside more. I got up a 6am to get ready to volunteer at church, when I realized it would be an excellent day to wear the pea coat. I was devastated when it didn’t fit. I almost wore it to prove to myself it was possible. I could have stretched it out and done up the buttons, but I knew deep down in that instant, that I was lying to myself and it wasn’t worth it. I reached over a few hangers and grabbed the biggest coat I owned, which is also much to insulated for indoor wearing, and zipped it up. I distinctly remember my hand passing over the 4 other jackets in my closet and settling on this one. It’s much to big, but it’s comfortable and it hides my imperfections. It hides the overeating I’ve done for months.

But it can’t really hide me from myself…

So tonight, I’m writing something. Maybe it’s more empty promises. I’m not sure. I’ve saved a few of my favorite salad restaurants in a Google map, hopeful that I’ll turn to them in my next moment of weakness, but I’m not sure I’ve convinced myself yet.

I think I’ve barely convinced myself this blog is worth posting.

Meh

I think I’m burnt out. Wow. Super surprising. The real question, is what the fuck am I burnt out on?

In the past few weeks, I’ve tried to look at every area of my life and take a break from what I can. My coworkers graciously picked up my slack at work for a few days, though I know my productivity since coming back has suffered. It’s so hard to focus. I can usually wake up after a good night’s sleep, 8 hours or more, and then by the time I walk to my office, the dread has set in.

Nature helps somewhat. I’ll make a move outdoors and I can feel somewhat rejuvenated, but the feeling is fleeting. I’ve tried visiting friends and family and again, I get that same temporary satisfaction of human contact, but then I have to retreat home to my cutout in the uptown skyline.

Pair that with the complete and total dietary failure and it just feels worse. I can’t help but dive into this self sabotage headfirst; concern for my future self thrown to the wind in search of momentary satisfaction.

And then the pity party afterwards. The catharsis of complaining to myself and to others. Synapses of satisfaction firing for a brief moment before they power down for another solitary serenade. It feels freeing to bitch and complain to the 3 people who I know will read this; some possessing real power to drastically alter my life, for better and worse.

I don’t know what to do. I probably definitely need a therapist, but the looming of Covid-Part-2 Electric Boogaloo has kept me away from professionals and amateurs alike. Instead I have you.

Thanks for listening, but I don’t blame you for leaving my sorry ass alone either.

Intermittent Fasting Update – September 2020 – Binging

Progress from August to September of 2020 – 237.5 lbs current weight

It’s been kind of a weird month. My diet has been pretty steady all things considered, but my progress was noticeably slower. I’ll talk a little further down about my experiences with binging this past week.

My birthday was August 18, and as a bit of a treat, that weekend I went to a local baker who specializes in low-carb and diabetic friendly confections and got a large cheesecake. I ended up snacking on that for 2 weeks and the side effects were interesting to say the least!

Warning: potentially gross content in the next few paragraphs. Skip to the next heading if you aren’t interested. One of the side effects of the artificial sweetener this bakery used, I think is constipation. I’ve tried searching for information but it tends to be mixed. Some sweeteners can cause diarrhea, while others can make you constipated. I’m usually a pretty regular dude, once or maybe twice a day if I eat a larger meal, but for whatever reason, this cheesecake stopped me up for 3 days at one point! It never really got to the point of discomfort, but it definitely could have I think if I didn’t make an effort to move things along.

If you find yourself in a similar situation, eat some straight plain salt. I ate a small pinch and then waited an hour, then got another one. I’m not 100% up on the science here, but salt is essentially natures laxative when taken on it’s own. Be warned though that you need to replenish your electrolytes (with more salt!) if you go this route.

Binging

I want to try and organize some thoughts here that I have on binging. Obviously, food is and was a massive (hah!) part of my life. I got fat from turning to food to cover up my problems. Sometimes I was just overeating, but looking back now, there were definitely periods of binging that weren’t healthy.

I feel like I sorta had one of those moments on Labor Day this past weekend. We had breakfast with some friends outside in their front lawn and to stay sociable, I worked out my eating schedule from the day before so I could join everyone. The menu was pancakes and bacon with fruit and juice. Not an unhealthy breakfast by any stretch, but definitely not first on my dietary list. I ate 3 pancakes with syrup, some bacon and a banana, then had some tortilla chips with a cream cheese dip a little later. If I had stopped there for the day, probably would have been fine.

Then later, I went to my parents house and had a late lunch. Chili cheese dogs (no bun!) but then a good portion of potato chips and some assorted popcorn while watching some movies.

Finally, on the way home, the wife and I stopped at an old drive-in burger place here in Dallas that we noticed that morning. I had a cheeseburger and some onion rings. Kellers

Now, normal people read this and don’t see a particularly large problem. However, I’ve been eating one meal a day for about 18 months now! 3 decently sized meals, all of which were by themselves over my carb limit is unusual.

Looking back, I think I just wanted to live in the moment and feel good. The food tasted good, everyone else was eating, it was easy. But that’s childish. Children do what feels good and act on impulses. I need to make a conscious effort to resist or remove myself from these situations in the future, but that’s a challenge in and of itself too.

The Next 30 Days

September, despite a rocky start, is looking better. Despite my binge at the start of this week, I’m back down on the scale and actually at my lowest weight of 2020! I think a good short term goal is under 230 lbs by the next update post, or even more ideally, before the end of the month. That’s going to take a lot of discipline though and maybe even a little exercise. Either way, I’m feeling good now and I think that’s something to celebrate.

One thing that I hope will make things easier is a change in my delivered meal plan. The past 2 boxes I ordered have featured 2 dishes that I didn’t totally love; Prime rib with blue cheese and brussels sprouts and a bun-less burger with artichoke hearts. The protein in each of these was fine, but the sides are putting me off now. The first few times I ate each of them I didn’t seem to mind, but the more times I eat each one, the less interested I am in those vegetables. I’m sure prepared differently I wouldn’t mind, but the sort of mushy-watery texture inherent in a frozen prepared food isn’t as appetizing. I want my food to work for me rather than make me want to eat something else. I’ve since purchased a few bags of frozen broccoli to supplement.

My newest order of delivered meals should be here tomorrow and does not include these dishes. I’m hoping this will keep me motivated to not talk myself into getting something to-go from a restaurant under the guise of “date-night” with my wife!

Conclusion

If you have questions, feel free to leave a comment or reach out on Twitter @daronspence . I’m sometimes slow to reply here on the site, but if more people comment it might motivate me 🙃

Also feel free to join my fasting circle on the app I use. Sorry! https://lifefastingtracker.app.link/z3D7qHg2W8

Intermittent Fasting Update – August 2020

My weigh in this morning was 241.4 but the average for the month is a little higher. As you can see from the below chart, this past 12 months has been ups and downs. You can see the gradual decline from my past posts discussing my progress before falling off the wagon.

This month has been interesting for sure. At the start of the month, I took a road trip with my 16 year old brother from Texas up to the Great Lakes. During our trip I stuck to my eating windows but went absolutely hog wild with what we ate. We were having a good time trying all of the local food and enjoying each other’s company.

Side note: Wisconsin cheese curds are fucking amazing…

Me

I thought I’d mention something else here as well that my wife keeps bringing up.

My current ritual is to weigh in on Friday mornings right after I wake up and use the bathroom. Depending on what I’m doing in regards to work, this might be 9-10am even if I wake up at 8am. During that time from rise to first bathroom break, I do not drink any water. I also try to not go ham with the water on Thursday night. My thought is that if I wake up and chug a 32oz cup of water, that I’ve essentially “gained” 2 pounds. In terms of keeping an accurate track of my weight loss numbers, this seems like an okay practice.

My wife thinks is unhealthy to think of water in such a negative way. I’m not sure if we’re having some sort of miscommunication as I’ve tried explaining it different way and she says she understands and still thinks it’s problematic. Tell me your thoughts. I’m interested to hear them!

My weekly routine

I’ve had various people ask about my routine so I thought I’d update the internet here with what I’m doing and what’s working currently. If I change something in between these posts I’ll try to remember to make a not of it in future posts.

Sunday

At the start of the week, I’m usually volunteering with my local church. Eating is a social activity we usually partake in with friends so I keep Sunday’s a bit lax. Obviously with Covid-19, we’re not going to church or seeing friends, but I still eat Dinner and sometimes a light lunch. I aim to stop all food intake by 10 PM.

Monday

This is a fasting day. No food, only water and my meds (asthma pills and some supplements). Ask your doctor if your medicine needs to be taken with food. Mine do not.

Tuesday

Around 5-6 PM (or later) I’ll eat dinner with the goal of finishing by 10 PM. My current diet consists of two meals from https://www.cleaneatzkitchen.com/ and then a bag of popcorn if I’m still hungry. I’ve really been trying to eat my food slower and allow the hormones to work their magic to make me feel full. The problem I still have to a degree is my ability to inhale food at such a rate that my body can’t even react to being full.

Most of the time I’ll start my fasting timer right after I finish eating, irregardless of the time. Bed time is around midnight.

Wednesday

Basically a repeat of Tuesday. I may eat an extra serving of some frozen vegetables in preparation for Thursday, but it depends.

Thursday

Another full fasting day! No food, just water and my meds. Like I mentioned before, I try to not go crazy with the liquids after 10pm or so because of weigh in on Friday morning. Basically I just want to ensure that I’ll have to pee soon after waking up and that my body is actually getting rid of the extra water I don’t need.

Friday

Weigh in day! I have a lot of work calls on Friday’s so it’s a busy morning. If I have to use the bathroom, I’ll do that and then immediately weigh myself. Tracking is always done in my birthday suit for maximum results and easier reproduction.

After that, it’s water and meds until 5-6 PM for dinner. Same meals as the previous week, though I’ve been known to grab some Wingstop on the weekend. Aim to finish eating by 10 PM.

Saturday

A repeat of my other eating days basically. If we were having social events, I’m sometimes less picky about eating times, but I still aim for 16 hours fasted as least. Rarely do we have events before noon so in those cases I would politely decline anything until later in the day. If we do have breakfast plans with someone, I’d probably eat, but opt for as low carb as possible. Eggs, bacon, vegetables. An omelette does sound pretty good right now. 🙂

Re: Food choices

I’ve historically made pretty terrible food choices. Weighing 310 pounds is evidence enough of that. Self control when it comes to food has been very difficult for me, and frankly a lot of other things as well.

I’m very spontaneous and when I want something I tend to get it pretty quickly afterwards. New toys, going somewhere, eating something. I’ve really had to work at controlling these urges and work on planning ahead of time.

As part of embracing more planning and self control, I opted to purchase pre-cooked meals in bulk. I’ve essentially removed any ability to cheat by limiting myself to these pre-purchased meals and a handful of pre-approved snacks!

So far, I have to admit that it seems to be working. I’m not tracking it explicitly, but my daily calorie intake on feasting days is somewhere around 1200-1600 calories. For a dude who still weighs 240 pounds, this is a significant deficit from what my body needs to function, thereby forcing it to burn more fat.

During my first attempt at this last year, I would say I was normally eating more than 2,000 calories a day making my own food. The portion sizes were larger mainly, and I wasn’t afraid to load up on low carb, yet calorie rich, liquids like ranch or butter.

I wonder when I’ll get to eat “normal” food again but for now this is working. Especially with the world in a state of quasi-lockdown, it is nice to not have to worry about making grocery store runs. My wife buys food for herself on her way to / from work.

Conclusion

If you have questions, feel free to leave a comment or reach out on Twitter @daronspence . I’m sometimes slow to reply here on the site, but if more people comment it might motivate me 🙃

Also feel free to join my fasting circle on the app I use. iOS only though! Sorry! https://lifefastingtracker.app.link/z3D7qHg2W8

Intermittent Fasting Update – July 2020

Long time no chat! It’s been over year since my last update and a lot has changed, and yet, some things continue to persist. As a fun aside, I think this is the first long form post I’ve written in the new WordPress block editor? I saw a popup welcoming me so I’m assuming…

Since my post in April, I’ve continued to make at least some progress on the personal health front. 2019 actually went pretty well, all things considered. I started a new job in September which brought it’s own challenges and new stresses, but I persevered and stuck to my fasting guns. The real challenge came at the tail end of the year when the holiday shenanigans started to roll in.

I had been doing really well, all things considered. I went from somewhere around 310 pounds down to 228 according to my weight tracker. 80 pounds in 9 months is no small feat! I used this new found confidence to convince myself I deserved some sort of reward. In this case, a guilt free holiday of indulgence with friends and family. My last weigh in was November 17, 2019 and I was feeling pretty good.

If we follow the trend line though, something happened. Retrospectives are always harder to perform without solid data and this is no exception. My next weigh in was February 2020. For 3 months, I neglected any sort of accountability to myself and fell off the wagon. I was still roughly watching the timing in which I ate, but my diet went back to a lot of the same shit it was before. I had changed some habits, sure, but even with healthier food options, it’s not hard to imagine gaining weight if you eat massive quantities of food.

When I dared step on the scale again in February, my weight had creeped back up to 240! Ten pounds in about 3 months. Now, taking into account that my lowest weight was done coming off of a 48 hour fast and when my diet featured few carbs, it’s not hard to attribute a lot of that to extra water that was hanging around with an increased carb intake. I remember at the time feeling bummed though.

The next weigh in was 2 weeks later. March 3, 2020. I was back down to 231.7! Success, I convinced myself it was all water weight and I was still on track. Typing this out I’m feeling elated and proud! I didn’t actually fuck up! I think you all know what happens next though…

Covid-19

The world fell into a bit of a tailspin. I’m sure you all have your own stories, so I won’t spend a lot of time here, but suffice to say, the introduction of a global pandemic was jarring.

My favorite coffee spot was closed, and coincidentally a lot of my weekly social life was reduced to uninspiring trips down the hall to the self serve coffee machine in my apartment building clubhouse. While I didn’t talk about my weight loss in those interactions, looking back I think there was a part of me that enjoyed the challenge of being noticed; of someone else seeing a marked change and making a comment. I knew from my trips to see family that I enjoyed the compliments I received and it felt good to have someone else acknowledge the hard work I put into bettering my future self.

The numbers don’t lie and at this point, my memory doesn’t either. I was stuck at home, but totally now, since I worked from home already before the pandemic. My wife’s schedule was weird as her job made changes. I was following a lot of the day to day politics of it all and getting depressed.

I turned back to my old friend food to cope. I don’t want to go back into my bank history and count the midnight trips to Whataburger, but there were a lot of them. My habits were somewhat better sure; unsweet tea is my new go to, and I was usually only getting one sandwich… but when you’re already eating dinner courtesy of a cheap meal box option that heavily features potatoes to reduce the cost of the service, it’s not surprising that my weight continued to rise.

I’d like to point out that that during all of this, my eating window largely remained in the popular fasting schedules. 16+ hours between meals was totally normal. Some days I was tired and went to bed early after dinner. Other days I ate lunch and dinner and a midnight snack, though those were more rarely seen.

Present Day

My most recent weigh in was July 3. 253 pounds. That’s 4~ pounds a month or roughly 14,000 calories, or a bit under 8 trips to Whataburger per month with my usual order. Not counting my indulgences at other fine dining establishments during the same time period! It’s not hard to imagine 8 extra meals per month sneaking in. Twice a week! What’s the harm? 20 pounds in the harm. Reversal of my hard earned progress is the harm. My confidence in myself is the harm.

Today is July 29, 2020. I’m writing this at the start of the day before starting work. I just got out of the shower and I’m listening to some quiet chill-hop to prevent my own brain from echoing to itself in the hollow box that is my head.

Yesterday, I did okay. I have a new meal service that is much healthier, at around the same cost per meal. It also requires much less time to prepare, making it easier to put off eating until I’m absolutely ravaging, thus prolonging my fasting times. I ate around 6pm. I did also finish off about a half a bag of tortilla chips with some leftover salsa from a restaurant trip last week that I didn’t want to just throw away for whatever reason. The chips ended up only making my hungrier so I made a couple of plain burger patties with a little cheese and some frozen peas.

I then waited a couple of hours and occupied myself with a video game until making a bag of popcorn around 9pm. By 9:20 I hit the button to start timing my next fast, feeling really full. I obviously ate too much. I could feel it, but at that point it was too late to do anything about it.

My current streak is sitting strong at a full week of my ideal fasting schedule. Eating only dinner, in a less than 4 hour window, 5 days a week, skipping food entirely on Monday and Thursday. Today is Wednesday, so I’ll be eating dinner again tonight, but I think I’m going to commit here in this post to only eating my pre-prepared meal somewhere between 8 and 10pm.

My next weigh in is Friday. Not sure if I’ll post that here, but I will be logging it of course! I’m hopeful to see the scale move in the “right” direction but you never know. It could go up even more, and that’s something I’ll have to live with and overcome. I sure hope it doesn’t though. 😅

If you enjoy reading these, send me a tweet @daronspence and let me know. Accountability is important to my own progression I’m finding and unfortunately it is hard to get that anywhere but online in our current world.

✌️