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
// Set the manual property of Prism object to true | |
window.Prism = { manual: true } | |
// Add an event listener for when the window is loaded | |
window.addEventListener('load', () => { | |
// Import the Prism.js library from the specified URL | |
import('https://cdnjs.cloudflare.com/ajax/libs/prism/9000.0.1/prism.min.js') | |
.then(() => { | |
console.log('Prism loaded.') |
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
########################### | |
# xbindkeys configuration # | |
########################### | |
# | |
# Version: 0.1.3 | |
# | |
# If you edit this, do not forget to uncomment any lines that you change. | |
# The pound(#) symbol may be used anywhere for comments. | |
# | |
# A list of keys is in /usr/include/X11/keysym.h and in |
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 | |
function get_youtube_channel_ID($url){ | |
$html = file_get_contents($url); | |
preg_match("'<meta itemprop=\"channelId\" content=\"(.*?)\"'si", $html, $match); | |
if($match && $match[1]); | |
return $match[1]; | |
} |
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
Show hidden characters
{ | |
"<router-link>": { | |
"scope": "html", | |
"prefix": ["rt", "rou", "rout"], | |
"body": [ | |
"<router-link to=\"$1\">$2</router-link>" | |
], | |
}, |
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
function fixOfxData (ofx) { | |
const lines = ofxData.split(/[\n\r]/) | |
const reUnclosedTag = /(^[^<]*<(.+)>[^>]+$)/ | |
// Fix unclosed tags line by line | |
for (var i=0; i<lines.length; i++) { | |
if (reUnclosedTag.test(lines[i].trim())) { | |
lines[i] = lines[i].replace(reUnclosedTag, '$1</$2>') | |
} | |
} |
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
// from https://blog.devarthur.com/javascript/como-ler-os-parametros-da-url-em-javascript/ | |
function getQueryParams (name, query) { | |
var query = location.search.slice(1) | |
var partes = query.split('&') | |
var data = {} | |
partes.forEach(function (parte) { | |
var chaveValor = parte.split('=') | |
data[chaveValor[0]] = chaveValor[1] | |
}) |
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
// from https://blog.devarthur.com/javascript/como-ler-os-parametros-da-url-em-javascript/ | |
function getQueryParam (name, query) { | |
// se o parâmetro query não foi definido pega o parâmetro da URL | |
if (!query) | |
query = window.location.search | |
var l = query.length | |
var n = '' // nome | |
var v = '' // valor |
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
function validaCPF(cpf) { | |
var Soma = 0 | |
var Resto | |
var strCPF = String(cpf).replace(/[^\d]/g, '') | |
if (strCPF.length !== 11) | |
return false | |
if ([ |
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
<script async src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script> | |
<script> | |
const awaitFor = function (cond, cb, timeout = 100) { | |
!cond() ? setTimeout(() => awaitFor(cond, cb, timeout), timeout) : cb() | |
} | |
awaitFor(() => typeof hljs !== 'undefined', function () { | |
const blocks = document.querySelectorAll('pre code') | |
blocks.forEach(hljs.highlightBlock) | |
}) | |
</script> |
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 | |
function wp_svg_inline_replacer($matches) { | |
$src = $matches[1]; | |
$parts = explode('/wp-content/', $src); | |
$svg = file_get_contents(WP_CONTENT_DIR . '/' . $parts[1]); | |
$svg = preg_replace('/<\?xml.*\?>/', '', $svg); | |
$svg = preg_replace('/<\!DOCTYPE[^>]*>/', '', $svg); | |
return trim($svg); |