Skip to content

Instantly share code, notes, and snippets.

View Guidhouse's full-sized avatar
😊

Henrik Runge Guidhouse

😊
  • contractor
  • Earth
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Guidhouse
Guidhouse / gist:17ffdfea3c83cc6df7fe725eee562d61
Created March 31, 2020 20:19
Restore to SqlServer on Docker
USE [master]
--Get logical names first
EXEC sp_restore_filelistonly
@device_type = 'DISK',
@backup_path = '/var/opt/mssql/data/DB.bak'
--Then restore
RESTORE DATABASE MarcRecordsDB
FROM DISK = '/var/opt/mssql/data/DB.bak'
@Guidhouse
Guidhouse / Escaperoom selector
Last active September 19, 2019 09:24
escape rooms
//first step
document.location = "https://nota.dk/om-nota/kontakt?department=206185"
//second step
names = [];terrorists=[]; monks = [];janitors =[];
document.querySelectorAll(".node--corp-employee").forEach((el) => {names.push(el);});
var n = 0
while(names[n]){
rnd = Math.floor(Math.random(3) * Math.floor(3));
rebate = $('.save-wrap .product-price-save');
offer = $('.product-image .product-price-save');
price = $('.price')
findRebate = (s) => {el = $(s).find(rebate)[0]; return( !!el)? parseInt(el.innerText.substr(5, 3)) : NaN };
findPrice = (s) => {el = $(s).find(price)[0]; return( !!el)? parseInt(el.innerText) : NaN };
findPercentage = (s) => (findRebate(s)/(findPrice(s) + findRebate(s)) * 100);
setText = (s) => {el = $(s).find(offer)[0]; if (!!el) { el.innerText = findPercentage(s).toPrecision(4) + " %" }};
@Guidhouse
Guidhouse / dabblet.css
Last active July 31, 2016 19:44
Shadows
/**
*Shadows
*/
div{
font: 150%/1 Helvetica, sans serif;
float:left;
color: blue;
margin:0.6em 1em;
position:relative;
max-width: 13em;
@Guidhouse
Guidhouse / dabblet.css
Created November 9, 2015 10:15 — forked from anonymous/dabblet.css
Corners and borders
/*
Corners and borders
*/
div{
font: 150%/1 Helvetica, sans serif;
float:left;
color: blue;
margin:2em;
position:relative;
max-width: 13em;
@Guidhouse
Guidhouse / dabblet.css
Last active October 30, 2015 07:39
Corners and borders
/*
Corners and borders
*/
div{
font: 150%/1 Helvetica, sans serif;
float:left;
color: blue;
margin:2em;
position:relative;
max-width: 13em;
@Guidhouse
Guidhouse / Hawes&Curtis
Last active October 6, 2015 04:20
Fun in the browser
Just for fun, hidding all shirts that doesn't have breast-pockets.
http://www.hawesandcurtis.co.uk/menswear/formal_shirts?fit=39&viewAll=True
Vanilla JS:
Firefox:
[].slice.call(document.getElementsByClassName('standard-product')).filter(x =>!(x.textContent.contains('Pocket'))).forEach(function(el){el.style.display = 'none'})
Edge (No contains):
String.prototype.contains = function(stringToSearchFor){return this.indexOf(stringToSearchFor) >-1;}
[].slice.call(document.getElementsByClassName('standard-product')).filter(x =>!(x.textContent.contains('Pocket'))).forEach(function(el){el.style.display = 'none'})
Chrome(No fat arrow, no contains):
[].slice.call(document.getElementsByClassName('standard-product')).filter(function(el){return el.textContent.indexOf('Pocket') === -1}).forEach(function(el){el.style.display = 'none'})