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 / 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 / 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;