Dec 3, 2023Programming
Browser fingerprinting protection can cause the RGB values of image data returned by context.getImageData() to be randomly off by a little bit (usually -1 or 1). So instead of solid black being rgba(0, 0, 0, 255) as expected, it might be rgba(0, 1, 0, 255) or similar.
Feb 16, 2023ProgrammingComments (5)
Here's a guide on how to get set up with the FedEx API and start making requests. I've included PHP code examples for retrieving tracking data using the Track API, but it can be adapted to any language and other FedEx APIs. This guide assumes you have decent knowledge on handling JSON objects and making HTTP requests.
Feb 14, 2023Programming
Here is a simple PHP script that generates US holidays for multiple years in YYYY-MM-DD format, and stores them in a basic array. Note that due to timezone differences, this may create unexpected results within 24 hours of a new year for users that are in different timezones.
Nov 23, 2017ProgrammingComments (7)
In Unity, the Android back button is treated the same as the "Escape" KeyCode. So in order to do something when the user presses the back button on their Android device, you need to check for the Escape key being pressed down and also make sure the user is on the Android platform (if you're cross-platform).
Jul 19, 2017Programming
When attempting to edit or create an eBay Shipping Policy in M2E Pro for Magento 2, you may come across an error like this:
May 16, 2017ProgrammingComments (3)
To create inward-moving particles using the stock Particle System in Unity, you need to set the Start Speed to a negative number. This reverses the direction of the particles so they move towards the center.
May 12, 2017Programming
This is a simple method for creating a self-signed SSL certificate on Windows. This is useful for testing and development purposes; you shouldn't use a self-signed SSL certificate on a production website.
Apr 12, 2017ProgrammingComments (9)
Amazon offers a PHP SDK for handling AWS and S3 requests, but it weighs in at over 500 files and nearly 5MB. If you just want to upload a file to an S3 bucket using PHP, you can create the HTTP POST request yourself using only about 50 lines of code. This is also useful if you want to understand how the request and authorization process work.
Mar 6, 2017ProgrammingComments (2)
This code creates an outline of a 2D mesh utilizing the LineRenderer component in Unity. It does not require any shaders and seems to run very quickly from my testing. It also supports meshes that have mutliple non-connected components.
Sep 28, 2016Programming
Here is a very simple example on using static properties and methods (variables and functions) with JavaScript.
Sep 6, 2016ProgrammingComments (14)
I was working on a 2D game in Unity and needed some way to automatically create a collider for a complex 2D level mesh. Editing a Polygon Collider 2D in the editor was out of the question, since there were thousands of vertices. I ended up writing a script that analyzes the MeshFilter of the mesh, and programmatically creates a Polygon Collider 2D for it. It also supports meshes that have mutliple non-connected components.
Sep 2, 2016ProgrammingComments (4)
Note: This code uses Amazon AWS Signature Version 2, which is not available on any S3 Regions created after January 30, 2014. It is recommended to use Version 4. Please view the AWS Version 4 post here.
--------------------
Amazon offers a PHP SDK for handling AWS and S3 requests, but it weighs in at over 500 files and nearly 5MB. If you just want to upload a file to an S3 bucket using PHP, you can create the HTTP POST request yourself using only about 30 lines of code. This is also useful if you want to understand how the request and authorization process work.
--------------------
Amazon offers a PHP SDK for handling AWS and S3 requests, but it weighs in at over 500 files and nearly 5MB. If you just want to upload a file to an S3 bucket using PHP, you can create the HTTP POST request yourself using only about 30 lines of code. This is also useful if you want to understand how the request and authorization process work.
Nov 30, 2015ProgrammingComments (2)
If you've updated to SourceTree 1.6.24 on your Windows computer and it keeps asking for a password, here is one potential workaround/solution that may work for you.
Apr 10, 2015Programming
X-Sendfile allows you to use PHP to instruct the server to send a file to a user, without having to load that file into PHP. It solves the problem of securely managing file access, without the excessive memory requirement of loading the file and reading it from PHP.
NewerPage 1Older