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 { defineConfig } from 'vite' | |
| import vue from '@vitejs/plugin-vue' | |
| import { resolve } from 'path' | |
| export default defineConfig({ | |
| base: "./", | |
| filenameHashing: false, | |
| plugins: [vue()], | |
| build: { | |
| rollupOptions: { |
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
| #!/bin/bash | |
| # Sometimes you need to move your existing git repository | |
| # to a new remote repository (/new remote origin). | |
| # Here are a simple and quick steps that does exactly this. | |
| # | |
| # Let's assume we call "old repo" the repository you wish | |
| # to move, and "new repo" the one you wish to move to. | |
| # | |
| ### Step 1. Make sure you have a local copy of all "old repo" | |
| ### branches and tags. |
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
| // Usage | |
| // <x-card-weather-forecast location="Guwahati" api-key="your-weatherapi.com-api-key" /> | |
| @props([ | |
| "location" => "Guwahati", | |
| "apiKey" => "", | |
| "poll" => 10000 | |
| ]) | |
| <div class="bg-white shadow rounded-lg p-5 dark:bg-gray-800 max-w-full" |
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\Traits; | |
| use App\Helpers\GeoHelper; | |
| use Grimzy\LaravelMysqlSpatial\Types\Point; | |
| trait AutoGeneratesPosition | |
| { |
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 | |
| // WordPress stores the site URL in the database by default (which I have never | |
| // understood), and it's a pain to have to type out the UPDATE SQL or search in | |
| // phpMyAdmin to change it. This is a simple way to put the URL into | |
| // wp-config.php instead. | |
| // Note that you will still need to update any URLs that appear in the content, | |
| // especially when you copy a database from a development site to production: | |
| // https://gist.github.com/davejamesmiller/a8733a3fbb17e0ff0fb5 |
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
| /** | |
| * Returns a user meta value | |
| * Usage [um_user user_id="" meta_key="" ] // leave user_id empty if you want to retrive the current user's meta value. | |
| * meta_key is the field name that you've set in the UM form builder | |
| * You can modify the return meta_value with filter hook 'um_user_shortcode_filter__{$meta_key}' | |
| */ | |
| function um_user_shortcode( $atts ) { | |
| $atts = extract( shortcode_atts( array( | |
| 'user_id' => get_current_user_id(), | |
| 'meta_key' => '', |
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 | |
| //* Do NOT include the opening php tag shown above. Copy the code shown below. | |
| add_action( 'init', 'rename_portfolio_custom_post_type_slug', 5 ); | |
| /** | |
| * Rename slug in Genesis Portfolio Plugin. | |
| * | |
| * @author Anita Carter | |
| * @link https://cre8tivediva.com/rename-genesis-portfolio-slug | |
| */ |
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
| /*** MAIN WRAPPER ***/ | |
| .gform_wrapper { | |
| background: #6000AA; | |
| padding: 5%; | |
| } | |
| /*** REMOVE LABEL FOR PLACEHOLDER ONLY ***/ | |
| .gform_wrapper .top_label .gfield_label, | |
| .gform_wrapper .field_sublabel_below .ginput_complex.ginput_container label { | |
| display: none; |
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 | |
| // See: http://blog.ircmaxell.com/2013/02/preventing-csrf-attacks.html | |
| // Start a session (which should use cookies over HTTP only). | |
| session_start(); | |
| // Create a new CSRF token. | |
| if (! isset($_SESSION['csrf_token'])) { | |
| $_SESSION['csrf_token'] = base64_encode(openssl_random_pseudo_bytes(32)); | |
| } |
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 | |
| /* | |
| Plugin Name: Disable plugins when doing local dev | |
| Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify | |
| Version: 0.1 | |
| License: GPL version 2 or any later version | |
| Author: Mark Jaquith | |
| Author URI: http://coveredwebservices.com/ | |
| */ |
NewerOlder