This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Handling Errors using async/await | |
| * Has to be used inside an async function | |
| */ | |
| try { | |
| const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
| // Success 🎉 | |
| console.log(response); | |
| } catch (error) { | |
| // Error 😨 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Console\Commands; | |
| use Exception; | |
| use Illuminate\Console\Command; | |
| use Illuminate\Support\Facades\DB; | |
| /** | |
| * SingleStore pre-checks command for migration evaluation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| declare(strict_types=1); // enforce strict typing so PHP catches bad stuff early | |
| // Simple coding agent in a single PHP 8.4 file inspired by Radan Skorić's 94‑line Ruby agent. | |
| // https://radanskoric.com/articles/coding-agent-in-ruby | |
| // Gives OpenAI‑backed chat plus four tools: read_file, list_files, edit_file, run_shell_command. | |
| // Every line is commented with the "why" to align with your preference. | |
| $apiKey = getenv('OPENAI_API_KEY'); // Pull the API key from env vars for security and portability | |
| if (!$apiKey) { // Fail fast if we can't talk to the model |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Define a function that performs the desired actions | |
| function executeActions() { | |
| console.log("Executing actions..."); | |
| document.querySelector('[aria-label="Items selection"] input').click(); | |
| document.querySelector('button[id^=awsui-button-dropdown__trigger]').click(); | |
| document.querySelector('[data-testid="DELETE_ITEM_BUTTON_ID"]').click(); | |
| document.querySelector('[data-testid="submit-form"]').click(); | |
| console.log("Actions executed."); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .gitlab-mreca-top-0 { | |
| top: 0 !important; | |
| } | |
| .gitlab-mreca-mr-version-controls-sticky { | |
| position: sticky; | |
| top: 72px; | |
| z-index: 999; | |
| padding-bottom: 3px; | |
| background-color: white; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function update_on_post_saved( $post_id ) { | |
| if ( wp_is_post_revision( $post_id ) ) return; | |
| if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return; | |
| // if ('NNN' !== $_POST['post_type']) return; return if post type is not NNN | |
| // unhook this function so it doesn't loop infinitely | |
| remove_action('save_post', 'update_on_post_saved'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| document.getElementById('remove-onclick').removeAttribute("onclick"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <form class="languages go" method="get" action="#"> | |
| <label for="language">Other languages:</label> | |
| <select id="language" class="autosubmit" name="lang"> | |
| <option title="English (US)" value="en-US"> | |
| English (US) (en-US) | |
| </option> | |
| <option title="Afrikaans" value="af"> | |
| Afrikaans (af) | |
| </option> | |
| <option title="Arabic" value="ar"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| stages: | |
| - deploy | |
| .setup_staging_env_file: &setup_staging_env_file | | |
| echo "$STAGING_SECRETS" > staging_secrets.php | |
| .setup_production_env_file: &setup_production_env_file | | |
| echo "$PRODUCTION_SECRETS" > production_secrets.php | |
| staging: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DB_NAME=database_name | |
| DB_USER=database_user | |
| DB_PASSWORD=database_password | |
| DB_HOST=database_host | |
| WP_ENV=development | |
| WEBROOT_FOLDER_NAME=if_necessary | |
| WP_HOME=http://example.com | |
| WP_SITEURL=${WP_HOME}/wp |
NewerOlder