This file contains 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
version: '2' | |
services: | |
nginx-proxy: | |
image: jwilder/nginx-proxy | |
ports: | |
- "80:80" | |
- "443:443" | |
- "3306:3306" | |
volumes: |
This file contains 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: WC Products Shortcode by User | |
* Description: Ass "current_user" to [products] shortcode to show only products from current user. | |
* Version: 1.0.0 | |
* Author: Mário Valney | |
* Author URI: https://mariovalney.com | |
* Text Domain: wc-products-shortcode-by-user | |
* |
This file contains 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 | |
header("Content-type: text/csv"); | |
header("Content-Disposition: attachment; filename=file.csv"); | |
header("Pragma: no-cache"); | |
header("Expires: 0"); | |
// Load file | |
$xml_string = file_get_contents(dirname(__FILE__) . '/file.xml'); | |
str_replace($xml_string, 'dc:', 'dc-'); |
This file contains 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
/** | |
* Developed by Mário Valney <[email protected]> | |
* | |
* Inspired on "Save Extra JPEG" and created using: | |
* https://www.adobe.com/content/dam/acom/en/devnet/photoshop/pdfs/photoshop_scriptref_js.pdf | |
*/ | |
/** | |
* @@@BUILDINFO@@@ Save PNG 4 XP.jsx 1.0.0 Thu Oct 24 2019 19:21:44 GMT-0300 | |
*/ |
This file contains 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
"use strict"; | |
const API_URL = "https://api.example.com/your-endpoint"; // Your API request | |
const SLACK_URL = ""; // Check: https://api.slack.com/incoming-webhooks | |
const NOTIFICATION = {text: "ITEM I WANT CHANGED!"}; // Message sent to Slack | |
const INTERVAL = 60000; // Interval in miliseconds | |
const interval = setInterval(() => { | |
fetch(API_URL) | |
.then(response => { |
This file contains 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
'use strict'; | |
jQuery(document).ready(function($) { | |
// Nineth Digit behavior | |
var ninethDigitMask = function( val ) { | |
return ( val.replace( /\D/g, '' ).length === 11 ) ? '(00) 00000-0000' : '(00) 0000-00009'; | |
} | |
// Multiple Documents Behaviour | |
var multipleDocumentsMask = function( val, e, field, options ) { |
This file contains 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\Database; | |
interface Database | |
{ | |
public static function getInstance(); | |
public function create(string $table, array $columns); |
This file contains 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 | |
/** | |
* Return a string replacing placeholder by a number | |
* | |
* You can create 'item-1', 'item-2', 'item-3'... globally | |
* just calling unique_string_id('item{id}') | |
* | |
* @param string $string | |
* @param bool $includeOne |
This file contains 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
// 1 - Ótimo / 5 - Péssimo | |
var checkboxes = $$('[value="1"]'); | |
for (var i = 0; i < checkboxes.length; i++) { | |
checkboxes[i].checked = true; | |
} |
This file contains 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: WP Thanos | |
* Description: Snap half of all users from your site. | |
* Version: 1.0.0 | |
* Plugin URI: https://gist.github.com/mariovalney/936e70dbc1ea84396afe4683b531c642 | |
* Author: Mário Valney | |
* Author URI: https://valney.dev | |
* Text Domain: wp-thanos | |
*/ |