Skip to content

Instantly share code, notes, and snippets.

Sten Hougaard netsi1964

View GitHub Profile
@netsi1964
netsi1964 / Readme.md
Created Oct 20, 2018
Shortcuts for iOS 12
View Readme.md

Shortcuts for iOS 12

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

Show in maps where photo was taken

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
The first commented line is your dabblet’s title
View dabblet.css
/**
* 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 Apr 11, 2018
Visual Studio Code Extensions
View vscode.extensions.txt
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 Apr 11, 2018
Extract data from wiki-pedia
View README.md
@netsi1964
netsi1964 / extractPropsAndValues.js
Last active Feb 15, 2018
Extract props and values to JSON
View extractPropsAndValues.js
// 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 Feb 12, 2018
If a website dont like your add blocker - run this script in the console
View removeBlockingFromSite.js
Array.from(document.querySelectorAll('*')).map(ele => {
if (parseInt(getComputedStyle(ele).zIndex)>0) {
ele.style.display = 'none'
}
})
View A place to share a (360 degree) images.md

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 Oct 5, 2017
Run this in console to remove request to disable add blocker
View removeAddBlockerOverlay.js
Array.from(document.querySelectorAll('*')).map(ele => {ele.style.overflow = 'inherit';getComputedStyle(ele).zIndex>0 ? ele.remove() : null})
@netsi1964
netsi1964 / getIphoneModelJSON.js
Last active Sep 13, 2017
Get Apple product JSON info
View getIphoneModelJSON.js
var model = {name:document.querySelector('.localnav-header a').innerText, url:document.location.href, variants:[],memory:[]}
Array.from(document.querySelectorAll('.as-dimension-choices li')).map(size => {
let name = size.querySelector('label').innerText;
let ram, price;
let isPrice = size.querySelector('img')===null
if (isPrice) {
ram = size.querySelector('.as-dimension-capacity-text').innerText.split(' ')[0];
price = parseFloat(size.querySelector('.price-point').innerText.split(' ')[0].replace('.','').replace(',','.'));
model.memory.push({ram,price})
} else {
@netsi1964
netsi1964 / toTimeString.js
Created Sep 12, 2017
Convert a youtube time to visual hh:mm:ss
View toTimeString.js
Object.prototype.toTimeString = function() {
var t = parseFloat(this);
var hou = (parseInt(t / 3600) % 24).toString().padStart(2, "0"),
min = (parseInt(t / 60) % 60).toString().padStart(2, "0"),
sec = parseInt(t % 60)
.toString()
.padStart(2, "0");
return `${hou}:${min}:${sec}`;
};
You can’t perform that action at this time.