Skip to content

Instantly share code, notes, and snippets.

View netsi1964's full-sized avatar

Sten Hougaard netsi1964

View GitHub Profile
@netsi1964
netsi1964 / generateSelectors.js
Last active June 2, 2019 20:08
Create list of selectors for all elements on a page
const html = [...document.querySelectorAll("*")]
.map(e => {
let html = "";
let ee = e,
id = "",
unique = false;
let selectors = [];
while (ee.parentNode && !id && !unique) {
const classes = [...ee.classList].sort().join(".");
const id = ee.getAttribute("id");
const players = [{"team":"FC Midtjylland","country":"Denmark","flag":"Denmark","name":"Lasse Heinze","age":28,"yearOfBith":1986,"position":"Goalkeeper","physique":{"height":"184","weight":"80"}},{"team":"FC Midtjylland","country":"Finland","flag":"Finland","name":"Tim Sparv","age":27,"yearOfBith":1987,"position":"Midtfield","physique":{"height":"194","weight":"84"}},{"team":"FC Midtjylland","country":"Nigeria","flag":"Nigeria","name":"Oluwafemi Ajilore","age":30,"yearOfBith":1984,"position":"Midtfield","physique":{"height":"182","weight":"73"}},{"team":"FC Midtjylland","country":"Denmark","flag":"Denmark","name":"Jim Larsen","age":29,"yearOfBith":1985,"position":"Defence","physique":{"height":"190","weight":"90"}},{"team":"FC Midtjylland","country":"Denmark","flag":"Denmark","name":"Jakob Poulsen","age":31,"yearOfBith":1983,"position":"Midtfield","physique":{"height":"182","weight":"75"}},{"team":"FC Midtjylland","country":"Sweden","flag":"Sweden","name":"Petter Andersson","age":29,"yearOfBith":1985,"position
@netsi1964
netsi1964 / Readme.md
Created October 20, 2018 09:43
Shortcuts for iOS 12

Shortcuts for iOS 12

This is a collection of various usefull shortcuts for iOS 12.

Choose a photo and if any location data was inside photo the Apple Maps app will be open with a marker at that location.

@netsi1964
netsi1964 / dabblet.css
Created May 1, 2018 06:50
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@netsi1964
netsi1964 / vscode.extensions.txt
Created April 11, 2018 07:20
Visual Studio Code Extensions
code --install-extension Angular.ng-template
code --install-extension BriteSnow.vscode-toggle-quotes
code --install-extension cssho.vscode-svgviewer
code --install-extension DotJoshJohnson.xml
code --install-extension eamodio.gitlens
code --install-extension EditorConfig.EditorConfig
code --install-extension eg2.tslint
code --install-extension formulahendry.auto-close-tag
code --install-extension formulahendry.auto-rename-tag
code --install-extension formulahendry.code-runner
@netsi1964
netsi1964 / README.md
Last active April 11, 2018 15:37
Extract data from wiki-pedia
@netsi1964
netsi1964 / extractPropsAndValues.js
Last active February 15, 2018 21:22
Extract props and values to JSON
// https://www.w3.org/TR/SVG/text.html#AlignmentBaselineProperty
var props = {}
Array.from(document.querySelectorAll('.propdef')).map(property => {
const pn = property.querySelector('.propdef-title.prop-name');
const propertyName = pn.innerText.replace(/[‘’]/ig, '');
const options = property.querySelector('.propinfo tbody tr td:nth-child(2)').innerText.split(' | ');
props[propertyName] = options;
})
let keys = Object.keys(props);
keys.map(key => {
@netsi1964
netsi1964 / removeBlockingFromSite.js
Created February 12, 2018 20:11
If a website dont like your add blocker - run this script in the console
Array.from(document.querySelectorAll('*')).map(ele => {
if (parseInt(getComputedStyle(ele).zIndex)>0) {
ele.style.display = 'none'
}
})

A place to share (360 degree) images

Before I used to use Dropbox with the Public folder to share stuff, but it has become difficult now I think. So I try using gists, following this description.

@netsi1964
netsi1964 / removeAddBlockerOverlay.js
Created October 5, 2017 10:03
Run this in console to remove request to disable add blocker
Array.from(document.querySelectorAll('*')).map(ele => {ele.style.overflow = 'inherit';getComputedStyle(ele).zIndex>0 ? ele.remove() : null})