Skip to content

Instantly share code, notes, and snippets.

View dilverdev's full-sized avatar
:octocat:
I may be slow to respond.

dilver.dev dilverdev

:octocat:
I may be slow to respond.
View GitHub Profile
@dilverdev
dilverdev / getTitleNative.js
Created September 26, 2018 15:58 — forked from jbinto/getTitleNative.js
Get title from remote HTML URL - without jQuery
// Only using native browser features (no jQuery).
// Uses `fetch`, `DOMParser` and `querySelectorAll`.
const getTitle = (url) => {
return fetch(`https://crossorigin.me/${url}`)
.then((response) => response.text())
.then((html) => {
const doc = new DOMParser().parseFromString(html, "text/html");
const title = doc.querySelectorAll('title')[0];
return title.innerText;
@dilverdev
dilverdev / env.js
Last active August 27, 2019 19:47
Configuration env in javascript
const envConfig = {
development: {
SITE_URL: 'http://localhost:3000',
API_URL: 'http://localhost:3000/api'
},
testing: {
SITE_URL: 'https://test.site.com',
API_URL: 'https://api.test.site.com'
},
production: {
@dilverdev
dilverdev / location.mixin.js
Last active February 17, 2020 20:01
mixin global
import Vue from 'vue'
export default {
install(Vue) {
Vue.mixin({
... metodos, computed, etc
})
}
@dilverdev
dilverdev / index.js
Last active February 25, 2020 03:46
loop comment facebook mobile web
setInterval(() => {
const newNumber = Math.floor(Math.random() * 10)
document.querySelector("#composerInput").value = 'soy otro del oto boot ' + newNumber
document.querySelector("#u_0_3o > input[type=hidden]").value = 'soy otro del oto boot ' + newNumber
document.querySelector("#comment_form_100000476487163_4034457913246718 > div._7om2._2pin._2pi8._4-vo > div:nth-child(3) > button").disabled = false;
document.querySelector("#comment_form_100000476487163_4034457913246718 > div._7om2._2pin._2pi8._4-vo > div:nth-child(3) > button").click();
}, 5000);
@dilverdev
dilverdev / share-urls.md
Created April 23, 2020 16:49 — forked from apisandipas/share-urls.md
Share url's for Facebook, Twitter, Pinterest and Linkedin with just get variables

Creating share buttons with just URL's

Twitter

http://twitter.com/share?text=<TITLE>&url=<URL>

E.g. http://twitter.com/share?text=This+is+google+a+search+engine&url=https%3A%2F%2Fwww.google.com

Facebook

http://www.facebook.com/sharer.php?u=&amp;p[title]=

@dilverdev
dilverdev / modal.html
Created April 27, 2020 04:44
Multiple Modal Vanilla
<div class="modal" id="modal-1">
<div class="modal-box">
<div class="modal-close">
<div class="icon-close"></div>
</div>
<div>
<!-- content -->
</div>
</div>
</div>
@dilverdev
dilverdev / contact-form.js
Created April 27, 2020 04:52
Events Contact Form 7
document.addEventListener('wpcf7invalid', function (event) {
console.log('wpcf7invalid')
}, false);
document.addEventListener('wpcf7spam', function (event) {
console.log('wpcf7spam')
}, false);
document.addEventListener('wpcf7mailsent', function (event) {
console.log('wpcf7mailsent')
@dilverdev
dilverdev / deploy_node.sh
Last active May 13, 2021 17:08 — forked from cvega93/deploy_git.sh
Easy automatic deploy bash for dummies
#!/bin/sh
projectname=$1;
# sh deploy-node [name]
cd /var/www;
mkdir $projectname;
cd $projectname;
touch ".env";
touch ".env";
mkdir builds;
@dilverdev
dilverdev / removeOverlay.js
Created May 30, 2020 22:28
Remove overlay
const removeOverlay = () => {
const overlay = document.getElementById('signwall-app')
overlay.remove()
const body = document.querySelector('body')
body.classList.remove('overflow-hidden')
body.style.overflow = 'scroll'
const html = document.querySelector('html')
html.classList.remove('overflow-hidden')
<template>
<div :style="{opacity: opacity}">
<slot />
</div>
</template>
<script>
import VueGoogleMaps from "map-element.js";
export default {
mixins: [VueGoogleMaps],
props: {