youkaihiei

Senior Developer at Urge Interactive

Experience

29,020

0 Best Reply Awards

  • Member Since 4 Years Ago
  • 405 Lessons Completed
  • 10 Favorites

10th August, 2018

youkaihiei left a reply on Instantiating Objects • 2 months ago

I would pass them in as arguments

31st March, 2018

youkaihiei left a reply on Unable To Test Filesystem TemporaryUrl • 6 months ago

In FilesystemAdapter.php I added the following to the beginning of the temporaryUrl() method (line 463):

if (env('APP_ENV') === 'testing') {
    return $path;
}

The Storage::fake('s3'); stuff just creates a local disk with the name you give it which is why the temporary url bit throws the error in testing (the local adapter doesn't have a temporaryUrl() method). Probably not a good or long term fix, but it works.

18th August, 2016

youkaihiei started a new conversation Collection::jsonSerialize Bottleneck • 2 years ago

Hey all!

I'm working on a Laravel 5.2 api and according to New Relic the bottleneck in response time I'm experiencing is the jsonSerialize() method on Illuminate\Support\Collection - its serializing about 1500 models returned by the query thats executing, which doesn't really seem like a lot to me. But I don't know, maybe it is haha. Each model has maybe about 25 properties. Has anybody experienced anything like this before? Any advice on dealing with it? (other than caching)

10th September, 2015

youkaihiei left a reply on Calculating Sectors Of Circles Around A Latitude & Longitude W/ PHP • 3 years ago

Thanks for the response! Its related but not necessarily what I'm after.

Forgive the photoshop skills haha but http://www.nathanielthomas.net/images/ltlngexample.jpg

The white dot in the middle is a latitude/longitude. A and B are each sectors of the circle made up of the radius around the circle (lets say 5 miles), so A is 0 degrees to 180 degrees and B is 180 degrees to 360 degrees, 5 miles away from the middle. The yellow dot is another latitude/longitude.

Right now I have this generated using the google maps api using the polygon plugin and the geometry plugin to find out if a given latitude/longitude falls inside of a polygon.

I'm trying to find out if theres an equivalent way to do that sort of thing in PHP.

youkaihiei started a new conversation Calculating Sectors Of Circles Around A Latitude & Longitude W/ PHP • 3 years ago

Hey everybody! Figured I'd try asking this here as a couple of days of wandering around stackoverflow hasn't proven very successful.

I'm basically building an angularjs front end/laravel back end application and want to know if what I'm currently using the Google Maps API for can be done with a PHP package or something.

I'm using it to draw sectors around a latitude and longitude (for example, two sectors would be two halves of a circle) and then determine whether or not another latitude and longitude falls inside of which sector.

4th March, 2015

youkaihiei left a reply on Laravel 4 From Scratch • 3 years ago

Hey there :)

I highly recommend using Homestead as your virtual machine to make your practice projects on. The reason you're getting those errors is because you need mcrypt installed, which you don't because you're running the installation script on your regular machine.

http://laravel.com/docs/5.0/homestead

Also it looks like you might be trying to install laravel 5. If you're going to use laravel 4, http://laravel.com/docs/4.2/installation

youkaihiei started a new conversation MySQL & Scaling • 3 years ago

Not necessarily a Laravel question but hopefully someone with more experience could provide some insight into some issues I've been having with executing a whole bunch of SQL queries efficiently.

Basically my situation is this. This is on WordPress and WooCommerce on my Homestead 2 local environment. I have a CSV with roughly 10,500 rows - they're all just sets of skus and a stock number to be updated. The bit I put together to parse the CSV is pretty quick when I have it just echo out each sku, it takes between half a second to one second to finish.

The issue comes when I try to have it update the database for each record - it times out with nothing written to any error files I can find. The same thing happens when I just try retrieving the product id by its sku. I imagine this has to do with the fact that its trying to perform a whole bunch of operations at once.

Before I started trying to improve its performance it worked but took forever (between 20 minutes to a half hour) to run entirely and when I tried to make it write to a file when finished for testing (for example, how many skus had their stock updated) it didn't seem to make it that far.

I've tried using wpdb, pdo, and wp_query with no success.

I have similar issues when trying to use the REST api to get all of the products out of the database (a third party wants them), cURL would time out and I would increase the CURLOPT_TIMEOUT but I don't think thats a very sustainable fix as I imagine the time it takes to get all of the products would increase as more products are added and I'd have to go in and increase the timeout limit again. 20 products works just fine, all 300 and their variations not so much.

Anyways, any help or insight would be greatly appreciated :) thanks!

3rd March, 2015

youkaihiei left a reply on Laravel 4.2 / Homestead 2.0.6 Mime Types Issue • 3 years ago

Haha oh man, stupid mistake on my part. I had the 404 route going to the index view and had the URL to the asset wrong, so it was returning that instead of an actual error. Thanks for pointing me in the right direction! :)

youkaihiei left a reply on Laravel 4.2 / Homestead 2.0.6 Mime Types Issue • 3 years ago

Lines 26 and 27

include /etc/nginx/mime.types; default_type application/octet-stream;

youkaihiei started a new conversation Laravel 4.2 / Homestead 2.0.6 Mime Types Issue • 3 years ago

Hey there!

After about a day of trying to figure this out I'm stumped. Basically I have a laravel application (4.2) on Homstead 2.0 and when I try loading javascript assets they're being sent from the server with the wrong mime type; for example loading jQuery from the site doesn't work and the console says "Resource interpreted as Script but transferred with MIME type text/html: " but using the CDN works. It sounds like the same issue this guy is having http://stackoverflow.com/questions/28612354/homestead-responding-mime-type-text-html except I haven't moved the project from OSX to Windows.

Any help figuring out whats up with that would be greatly appreciated :)

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.