A Pen by Shane Madsen on CodePen.
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
| import requests | |
| import json | |
| # Your Spotify app credentials | |
| CLIENT_ID = "" | |
| CLIENT_SECRET = "" # Replace with your actual client secret | |
| REDIRECT_URI = "https://httpbin.org/anything" | |
| # The authorization code you received | |
| AUTH_CODE = "YOUR_AUTH_CODE" # Replace with the actual authorization code you received |
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
| /** | |
| * This componet handles icon upload along with preview and drag drop. | |
| * Usage: include it as xtype: 'imageuploadfield', including this field in a form requires us to submit it via a method submitWithImage instead of submit. | |
| */ | |
| Ext.define('SomeNameSpace.ImageUploadField', { | |
| alias: 'widget.imageuploadfield', | |
| extend: 'Ext.form.FieldContainer', | |
| /** |
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 | |
| /** | |
| * Filters the posts by the specified author and returns the matching post IDs. | |
| * If no matching posts are found, it returns a message indicating that no posts were found for the specified author. | |
| * | |
| * @param string $search_author The author to filter the posts by. | |
| * @return array|string The array of matching post IDs or a message indicating no posts were found. | |
| */ | |
| if (!empty($search_author)) { |
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
| <div class="bg-{{ $backgroundColor }}" x-data="colorContrast()" x-bind:class="textColorClass"> | |
| <p>Text som ska ändra färg beroende på bakgrundsfärg</p> | |
| <a class="leading-non inline-block rounded-3xl border px-6 py-4 text-xs font-bold no-underline" href="{{ $card['card_button']['url'] }}" x-bind:class="borderColorClass"> | |
| {{ $card['card_button']['title'] }} | |
| </a> | |
| </div> | |
| <script> | |
| document.addEventListener('alpine:init', () => { | |
| Alpine.data('colorContrast', () => ({ |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Alpine Ajax test</title> | |
| </head> | |
| <body> | |
| <h1>Users API Retrieval Test</h1> |
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
| How to Read WordPress Block Content Programmatically | |
| https://www.ibenic.com/read-wordpress-block-content-programmatically/ | |
| Creating a Server-Side Rendered ACF Field Block for WordPress | |
| https://wpblockz.com/tutorial/learn-gutenberg-block-building-create-a-block-that-renders-an-acf-field/ | |
| Coding Gutenberg Toggle Control Block Settings | |
| https://wpblockz.com/tutorial/wp-gutenberg-editor-controls-form-toggle/ | |
| Remove the default block patterns from WordPress |
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 | |
| public function postFilter() | |
| { | |
| // Define custom post type and taxonomies | |
| $post_type = 'product'; | |
| $taxonomies = array('brand', 'category'); | |
| // Get the current page number | |
| $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; |
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
| head() { | |
| # Usage: head "n" "file" | |
| while IFS= read -r line; do | |
| printf '%s\n' "$line" | |
| i=$((i+1)) | |
| [ "$i" = "$1" ] && return | |
| done < "$2" | |
| # 'read' used in a loop will skip over | |
| # the last line of a file if it does not contain |
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
| @mixin svg-icon($name, $height: 24, $width: 24, $color: $color-primary) { | |
| -webkit-mask-size: contain; | |
| -webkit-mask-repeat: no-repeat; | |
| -webkit-mask-position: center; | |
| height: calc($height / $base-font-size) + rem; | |
| width: calc($width / $base-font-size) + rem; | |
| background-color: $color; | |
| mask-image: url(~@images/icons/#{$name}.svg); | |
| background-size: cover; | |
| mask-size: contain; |
NewerOlder