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 | |
| use Exception; | |
| use Embed\Embed; | |
| class Oembed | |
| { | |
| /** | |
| * Accepted Urls | |
| * |
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 | |
| add_action( 'woocommerce_before_calculate_totals', function () { | |
| if ( is_user_logged_in() ) { | |
| if ( in_array( 'highdiscount', WC()->cart->get_applied_coupons() ) ) { | |
| WC()->cart->remove_coupon( 'highdiscount' ); | |
| WC()->cart->add_discount( 'lowdiscount' ); | |
| } | |
| } | |
| }); |
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
| <?xml version="1.0"?> | |
| <ruleset name="WordPress Coding Standards based custom ruleset for your plugin"> | |
| <description>Generally-applicable sniffs for WordPress plugins.</description> | |
| <!-- What to scan --> | |
| <file>.</file> | |
| <exclude-pattern>/vendor/</exclude-pattern> | |
| <exclude-pattern>/node_modules/</exclude-pattern> | |
| <!-- How to scan --> |
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
| { | |
| "workbench.startupEditor": "none", | |
| "markdown.preview.fontSize": 12, | |
| "editor.suggestSelection": "first", | |
| "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue", | |
| "editor.fontSize": 16, | |
| "editor.lineHeight": 42, | |
| "workbench.colorCustomizations": { | |
| "[Inspired Github]": { | |
| "editorLineNumber.foreground": "#999", |
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
| { | |
| "workbench.startupEditor": "none", | |
| "markdown.preview.fontSize": 12, | |
| "editor.suggestSelection": "first", | |
| "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue", | |
| "editor.fontSize": 16, | |
| "editor.lineHeight": 42, | |
| "workbench.colorCustomizations": { | |
| "[Inspired Github]": { | |
| "editorLineNumber.foreground": "#999", |
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\Providers; | |
| use App\Post as Post; | |
| use App\Policies\PostPolicy as PostPolicy; | |
| use Illuminate\Support\Facades\Gate; | |
| use Illuminate\Support\ServiceProvider; | |
| class AuthServiceProvider extends ServiceProvider |
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 | |
| $ips = file_get_contents( 'https://www.cloudflare.com/ips-v4' ); | |
| $ips = explode( PHP_EOL, $ips ); | |
| $result = ''; | |
| foreach ( $ips as $ip ){ | |
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 prefix_get_custom_sidebar() { | |
| global $post, $wp_embed; | |
| $custom_sidebar = get_post_meta( $post->ID, 'custom_sidebar', true ); | |
| $custom_sidebar = $wp_embed->autoembed( $custom_sidebar ); // Apply oEmbed filter | |
| return $custom_sidebar; |
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\Helpers; | |
| use Config; | |
| class MjmlHelper | |
| { | |
| public static function auth() { | |
| if ( empty( env('MJML_APPID') ) || empty( env('MJML_APPSECRET') ) ) return; | |
| return base64_encode(env('MJML_APPID').':'.env('MJML_APPSECRET')); |
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 color_brightness($hex) { | |
| $hex = str_replace('#', '', $hex); | |
| $strl = strlen($hex)/3; | |
| $c_r = hexdec(substr($hex, 0, $strl)); | |
| $c_g = hexdec(substr($hex, $strl, $strl)); | |
| $c_b = hexdec(substr($hex, $strl*2, $strl)); | |
| $brightness = (($c_r * 299) + ($c_g * 587) + ($c_b * 114)) / 1000; |