{"id":16462521,"url":"https://github.com/luisprmat/useful-tricks","last_synced_at":"2026-02-13T17:32:50.896Z","repository":{"id":110611278,"uuid":"523533380","full_name":"luisprmat/useful-tricks","owner":"luisprmat","description":"Some programming tricks for develop apps","archived":false,"fork":false,"pushed_at":"2022-08-11T00:45:35.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-03T08:39:41.778Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luisprmat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-11T00:11:26.000Z","updated_at":"2022-08-11T00:11:26.000Z","dependencies_parsed_at":"2023-03-22T21:41:07.305Z","dependency_job_id":null,"html_url":"https://github.com/luisprmat/useful-tricks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/luisprmat/useful-tricks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisprmat%2Fuseful-tricks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisprmat%2Fuseful-tricks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisprmat%2Fuseful-tricks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisprmat%2Fuseful-tricks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luisprmat","download_url":"https://codeload.github.com/luisprmat/useful-tricks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luisprmat%2Fuseful-tricks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29413402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T06:24:03.484Z","status":"ssl_error","status_checked_at":"2026-02-13T06:23:12.830Z","response_time":78,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T11:11:31.974Z","updated_at":"2026-02-13T17:32:50.882Z","avatar_url":"https://github.com/luisprmat.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Useful Tricks\nSome programming tricks for develop apps.\n## FakerPHP doesn't work!\nSometimes [FakerPHP](https://fakerphp.github.io/formatters/image) doesn't generate images properly. In this case I use a dirty trick (from a [Laravel](https://github.com/laravel/laravel) App):\n- Search in the file [`vendor/fakerphp/src/Faker/Provider/Image.php`](https://github.com/FakerPHP/Faker/blob/main/src/Faker/Provider/Image.php) the line with the variable `BASE_URL` and change its value by `https://placehold.jp`\n\n```diff\nclass Image extends Base\n{\n    /**\n     * @var string\n     */\n-   public const BASE_URL = 'https://via.placeholder.com';\n+   public const BASE_URL = 'https://placehold.jp';\n\n    public const FORMAT_JPG = 'jpg';\n    public const FORMAT_JPEG = 'jpeg';\n    public const FORMAT_PNG = 'png';\n    \n    // ...\n}\n```\n\n- In the same file search the line `curl_setopt($ch, CURLOPT_FILE, $fp);` (approx line [144](https://github.com/FakerPHP/Faker/blob/main/src/Faker/Provider/Image.php#L144)) inside the static method `image` and *add* two new lines as in the code fragment.\n\n```diff\nclass Image extends Base\n{\n    // ...\n    \n    public static function image(\n        // parameters\n    ) {\n    \n    // ...\n    \n    // save file\n        if (function_exists('curl_exec')) {\n            // use cURL\n            $fp = fopen($filepath, 'w');\n            $ch = curl_init($url);\n            curl_setopt($ch, CURLOPT_FILE, $fp);\n+           curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n+           curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n            $success = curl_exec($ch) \u0026\u0026 curl_getinfo($ch, CURLINFO_HTTP_CODE) === 200;\n            // ...\n        }\n        // ...\n    }\n    \n    // ...\n}\n```\n- Ready!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluisprmat%2Fuseful-tricks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluisprmat%2Fuseful-tricks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluisprmat%2Fuseful-tricks/lists"}