Skip to content

Instantly share code, notes, and snippets.

View jrmarqueshd's full-sized avatar
💭
Desenvolvendo...

Junior Marques jrmarqueshd

💭
Desenvolvendo...
View GitHub Profile
SET @oldsite='http://localhost.com';
SET @newsite='http://producao.com.br';
UPDATE wp_options SET option_value = replace(option_value, @oldsite, @newsite) WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, @oldsite, @newsite);
UPDATE wp_links SET link_url = replace(link_url, @oldsite, @newsite);
UPDATE wp_postmeta SET meta_value = replace(meta_value, @oldsite, @newsite);
UPDATE wp_posts SET guid = replace(guid, @oldsite, @newsite);
@jrmarqueshd
jrmarqueshd / sftpautosave.json
Last active September 2, 2019 19:47
SFTP auto save
"watcher": {
"files": "**/{css/style.css,css/admin.css,js/main.js}",
"autoUpload": true,
"autoDelete": false
},
// Variaveis JS
let date = new Date();
let year = date.getUTCFullYear(-3);
let since = 2019;
// Variaveis Browser
let $year = document.getElementById("year");
$year.innerText = since==year ? `${year} ` : `${since} - ${year} `;
npx create-react-app my-app
cd my-app
npm start
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var watch = require('gulp-watch');
var concat = require('gulp-concat');
var cleanCSS = require('gulp-clean-css');
sass.compiler = require('node-sass');
function jrm_create_new_user(){
$user = 'username'; // Your username
$pass = 'password'; // Your Password
$email = 'e-mail'; // Your mail address
if( !username_exists( $user ) && !email_exists( $email ) ) {
$user_id = wp_create_user( $user, $pass, $email );
$user = new WP_User( $user_id );
$user->set_role( 'administrator' ); // User roles: default admin
}
@jrmarqueshd
jrmarqueshd / gist:ef68935bfc317555b36ca15bb169d84e
Last active September 8, 2019 01:14
loading animation in svg for content
<svg role="img" class="jss584" aria-label="" viewBox="0 0 400 100%" preserveAspectRatio="none"><rect x="0" y="0" width="100%" clip-path="url(#wx1f1a8h59)" style="fill: url(&quot;#1sj0x14jmdf&quot;);"></rect><defs><clipPath id="wx1f1a8h59"><rect x="0" y="10" rx="3" ry="3" width="390" height="10"></rect><rect x="0" y="35" rx="3" ry="3" width="370" height="10"></rect><rect x="0" y="60" rx="3" ry="3" width="180" height="10"></rect><rect x="0" y="100" rx="3" ry="3" width="380" height="10"></rect><rect x="0" y="125" rx="3" ry="3" width="390" height="10"></rect><rect x="0" y="150" rx="3" ry="3" width="320" height="10"></rect><rect x="0" y="190" rx="3" ry="3" width="390" height="10"></rect><rect x="0" y="215" rx="3" ry="3" width="380" height="10"></rect><rect x="0" y="240" rx="3" ry="3" width="290" height="10"></rect><rect x="0" y="265" rx="3" ry="3" width="220" height="10"></rect></clipPath><linearGradient id="1sj0x14jmdf"><stop offset="-2" stop-color="#bbbbbb" stop-opacity="1"><animate attributeName="offset" values
@jrmarqueshd
jrmarqueshd / Include zero before
Created September 20, 2019 12:46
Create for insert zero before number if number is less ten (create for date)
function insertZeroBefore(element) {
return element < 10 ? "0" + element : element;
}
if(document.querySelector('input[type="search"').getAttribute("search-field") == "on"){
const $searchInput = document.querySelector("input");
const $head = document.querySelector("html > head");
const styledCustimized = `<style> ul > li[custom-class="hidden"]{display: none!important;}</style>`;
$head.insertAdjacentHTML("beforeend", styledCustimized);
if(document.querySelector('ul[list-search-id="on"]')){
const $listToSearch = document.querySelector('ul[list-search-id="on"]');
let $childrenListSearch = $listToSearch.children;
$searchInput.addEventListener("keyup", ()=>{
@jrmarqueshd
jrmarqueshd / Configs to Emmet JSX on VSCode
Created October 2, 2019 13:01
paste this into settings.json
"emmet.syntaxProfiles": {
"javascript": "jsx",
},
"emmet.includeLanguages": {
"javascript": "javascriptreact",
}