Skip to content

Instantly share code, notes, and snippets.

View mateusortiz's full-sized avatar
🎯
Focusing

Mateus Ortiz mateusortiz

🎯
Focusing
View GitHub Profile
@fmasanori
fmasanori / 100 melhores livros segundo Le Monde.py
Created July 5, 2017 13:12
100 melhores livros segundo o Le Monde
#Laura Maia e Letícia Barreto
import requests
from bs4 import BeautifulSoup
url='https://pt.wikipedia.org/wiki/Os_100_livros_do_s%C3%A9culo_segundo_Le_Monde'
soup = BeautifulSoup(requests.get(url).text, 'html.parser')
nome=[nome.string.strip()
for nome in soup.findAll('i')]
ranking=[rank.string
@robdodson
robdodson / index.html
Last active October 4, 2023 18:57
Shady DOM example
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<h2>Hello from outside the Shadow DOM!</h2>

The Story of NPM and Yarn

In the beginning there was NPM, and for a time it was good. Packages went forth and multiplied. The New Gods proclaimed the great demon Dependency Management had been slain. But The Old Gods knew better, for they had seen much and knew that the demon can never be killed, only held at bay.

The Old Gods were ignored. In the folly of a young age grew an abundance of packages and with them grew the scourge of dependency. In the depths beneath the earth, in a place beyond memory, the great demon stirred.

The first sign something was wrong was non-deterministic package version mismatches. “This is fine!” The New Gods declared. “A temporary setback, nothing more! We can fix it.” And so they introduced shrinkwrap, a lamp to combat the growing darkness.

But it proved to be too little, too late, and dusk continued to fall. The New Gods suffered their first major defeat at the [Battle of Left-pad](https://www.theregister.co.uk/2016/03/23/npm_left_

@felipenmoura
felipenmoura / navigator.vibrate-visualizer.js
Created October 14, 2016 21:43
Use this to visualize the vibration result from the navigator.vibrate api.
(function (){
const originalVibrate = navigator.vibrate;
navigator.vibrate = function(){
var timer = 0;
var _b = document.body || false;
var curToggleStatus = true;
var previousBodyBorder = _b.style.border || 'none';
function toggle (force) {
@mateusortiz
mateusortiz / contrib.js
Last active November 27, 2019 02:02
GitHub API Contributors - List all contributors of project
(function (window, document) {
'use strict';
// Callback function
function appendContributors() {
/*jshint validthis: true*/
var result = JSON.parse(this.responseText),
tpl = '<li class="contributor" itemprop="itemListElement" itemscope itemtype="http://schema.org/Person"><a href="#"><img class="picture" width="90" height="90"></a></li>',
str = '',
@ebidel
ebidel / unregistered_custom_elements.bookmarklet.js
Last active May 30, 2019 19:17
Logs any custom elements on a page that are not registerd (e.g. missing an HTML import)
javascript:(function(){function isUnregisteredCustomElement(el){if(el.constructor==HTMLElement){console.error("Found unregistered custom element:",el);return true;}return false;}function isCustomEl(el){return el.localName.indexOf('-')!=-1||el.getAttribute('is');}var allCustomElements=document.querySelectorAll('html /deep/ *');allCustomElements=Array.prototype.slice.call(allCustomElements).filter(function(el){return isCustomEl(el);});var foundSome=false;for(var i=0,el;el=allCustomElements[i];++i){if(isUnregisteredCustomElement(el)){foundSome=true;}}if(foundSome){alert('Oops: found one or more unregistered custom elements in use! Check the console.');}else{alert('Good: All custom elements are registered :)');}})();