Open Challenge: Learn Lisp with Me

By Josh Sherman
2 min read
development
autodidacticism

Starting on May 1st, 2015, I am setting out to learn Lisp because I feel like I’m missing out by not knowing it. I see it come up pretty regularly, it’s stood the test of time and there are a plethora of dialects. I am going to target Common Lisp […]

Get all defined variables in PHP

By Josh Sherman
1 min read
development
php

I’ve never actually used this function, but could definitely see using it to help profile a system and/or to help identify defined but unused variables. To obtain an array of all of the defined variables you would: $defined = get_defined_vars(); The function returns a multi-dimensional array of all of the […]

Working with JSON in PHP

By Josh Sherman
1 min read
development
php

JSON is one of my favorite human readable formats. It’s widely used and has great support in PHP as well as other languages. PHP allows you to easily convert variables into JSON and JSON into objects or arrays. First, let’s take a look at how we can convert an array […]

Handling click and touch events on the same element

By Josh Sherman
2 min read
development
javascript
user experience

I’m starting to feel behind the curve. I started receiving feedback that some clickable elements on my social networks were not working on touch devices. Without much thought, I went ahead and added touchstart along side of click to bind both events: $(document).on('click touchstart', '.feeny', function(e) { alert('Believe in yourselves. […]

Truncate string with ellipses with PHP

By Josh Sherman
2 min read
development
php

We previously discussed how to calculate the length of a string in PHP and I made mention that using that function is how you would go about truncating a string if it’s over a specific length. I also said that down the road I would discuss the topic at hand, […]