Categories
php unit

Unit 7 Functions

This is just useful notes for my own later use. Spoiler alert if you don’t want the answers to these lessons than don’t read on any farther.

Lesson 7:

1.) Introducing Functions

strlen() string function. You pass this a string or a varialbe containing a string and it will return the number of characters in the string. Example:

$length = strlen("Samuel");
print $length;

2.) String Functions

substr() You pass this function the string you want to get a subsctring of, the character in your string to start at, and how many characters you want after your starting point. For example:

print the first 3 letters of my name:

$myname = "Samuel Bell";
$partial = substr($myname,0,3);
print $partial;

print my name in uppercase:

$uppercase = strtoupper($myname);
print $uppercase;

print my name in lowercase:

$lowercase = strtolower($uppercase);
print $lowercase;

Categories
Samuel Thoughts

thinking about a lost friend

I went walking late a few nights ago, totally on a whim. Just randomly decided to go out and stroll. It was relatively late, probably around 11:00 p.m. For some reason I just started thinking about you and got very emotional. And then here I was walking through the streets for a couple of hours just wandering and thinking, growing more emotional as I went. It was very odd timing wise. There was nothing specific that happened in my day or came up to remind me of you. I suppose it was slightly close to the 1 year anniversary of your passing (which you so cleverly planned to be the exact date of your wedding anniversary, such a planner).

Anyway I just wanted to write about that night so I could remember it in my mind. Try to keep the memory vivid. It felt great to walk and just think about you, try to ask you questions (I even asked them out load most of the time, if anyone saw me walking teary eyed talking to myself I was probably quite a funny site).

The bigger question is why did that walk happen when it did, what is the reason behind the timing. I’ve obviously still come no where near close to processing that your gone. I still find myself if not on a daily basis then for sure on a weekly basis thinking about something I was to talk to you about or ask you… and then I actually remember that I can’t. I still find it very troubling.

Categories
Fixing Stuff Laravel Samuel

stop tracking changes to a file in Sourcetree

Came across an annoying issue the past couple times I tried pushing commits to the remote repo on a current project. My local machine has a “nesting” error when serving this project locally that that I wrote about fixing in a previous post. Well now the issue was when I went to commit some new code it wanted to commit the bootstrap auto loader file, which of course I did not want committed to the repo since this is only a problem on my local machine.

So step 1 opened the .gitignore file and added bootstrap/autoloader.php to it…… and nothing. Source tree still kept trying to force me to merge in the change to the file. I then tried “stop tracking this file” in source tree by right clicking on it and selecting the stop tracking option. Still nothing. So then tried restarting source tree, pulling down ect… all various things to try and get sourcetree to stop tracking the file to no avail. So finally went searching for a git command that would force sourcetree to ignore the file and came upon:

git update-index --assume-unchanged file.filename

To run this I simply opened up gitbash, which we covered installing on windows in a previous post. So open up gitbash, cd to boostrap, then run our handy new command: git update-index –assume-unchanged file.filename

Viola the next time I opened source tree the file was no longer hanging in the uncommitted changes :). If you were running into a similar issue hopefully this simple git command will help you out too!

—update—
If we need to stop tracking an entire directory use:

git rm -r --cached path_to_your_folder/