How to Filter or Search HTML with Vanilla Javascript - No JQuery Required
The basic approach is to use the `document.querySelectorAll` to match certain elements, then manually set the display property to 'none' or 'block' (or 'inline-block') to hide or show it. Using the `match` method allows us to detect whether or not the sea...
Written by Sean Behan on 01/30/2018
How to Flatten and Merge Arrays in PHP
There is no built in function for taking a multi dimensional array in PHP and flattening it into a single array. However, it's pretty easy to accomplish in a one liner. Here is the code
...
Written by Sean Behan on 09/28/2018
How to Cast an Array to an Object with PHP
It's short and sweet.
$obj_from_array = (object)['key'=>'val'];
echo $obj_from_array->key;
Written by Sean Behan on 12/02/2017
How to Create a Date Time Snippet in Sublime Text 2 (Dynamic Signature with Time Stamp)
You'll have to create a new plugin. From the menu bar select
Tools > New Plugin
Copy the Python script from the signature.py file. Remember to replace your email address (it's example.com).
Save the file, signature.py, is fine. Next open up Prefer...
Written by Sean Behan on 06/17/2012
Output Logger and SQL to the Rails Console in Development Mode
If you want to take a look at the SQL being generated by active record while your using the console, you can either type this into the console when it loads
ActiveRecord::Base.logger = Logger.new(STDOUT)
Or you can add it to your environment so that it'...
Written by Sean Behan on 06/17/2012