Skip to content

Instantly share code, notes, and snippets.

View asathoor's full-sized avatar
:octocat:
Words! Words! Words! (Shakespeare)

Per Thykjaer Jensen (PETJ) asathoor

:octocat:
Words! Words! Words! (Shakespeare)
View GitHub Profile
@asathoor
asathoor / README.md
Created January 11, 2019 08:46
How to embed a Scratch production
@asathoor
asathoor / README.md
Created January 6, 2019 04:45
part of a solution where Manjaro refused to update because NPM had conflicting versions.

Remove troublemakers

Run the file as sudo from a terminal:

sudo ./removeTroubleMakers.bash

Then reinstall npm either via pacman or the GUI in Manjaro.

@asathoor
asathoor / dynamicImage.js
Created December 14, 2018 09:46
dynamic image javascript
const robot = 'images/myRobot.png';
// create in DOM
let img = document.createElement("img");
img.src = robot;
img.alt = 'A dangerous, wicked robot';
img.class = 'xxx-btn';
img.style.position = 'absolute';
// append to html
@asathoor
asathoor / seeker.html
Created October 2, 2018 10:30
Find bøger om et bestemt søgeord
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>ajax-xml</title>
</head>
@asathoor
asathoor / month.js
Created August 27, 2018 10:35
How to get a month
//document.write('<h3>' + greeting + '</h3>');
// dato
// @url: https://www.w3schools.com/js/js_date_methods.asp
let dagsDato = new Date();
let dag = dagsDato.getDay();
let maaned = dagsDato.getMonth();
console.log(maaned);
let aar = [
@asathoor
asathoor / bmi.html
Created August 27, 2018 10:11
Beregn BMI via JavaScript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
@asathoor
asathoor / map-sample
Created May 1, 2018 10:09
Mapbox in Pagebuilder Sample
<!-- the javascript will load the map here -->
<div id='map' style='width: 400px; height: 300px;'></div>
<!-- mapbox style and script -->
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.2/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.44.2/mapbox-gl.css' rel='stylesheet' />
<!-- mapbox map -->
<script>
mapboxgl.accessToken = 'YOUR-TOKEN-HERE';
@asathoor
asathoor / popups.html
Created April 5, 2018 08:37
Mapbox: several pop ups
How to create several popups
============================
@asathoor
asathoor / script.js
Created February 19, 2018 12:49
Sara: problem med videoplayer
/*
Javacsript til Amazing Philippines
Webdokumentar 2018
*/
var audioGalleri = [
"beach.mp3"
] ;
visAudio(audioGalleri[0]);
@asathoor
asathoor / path-to-image.php
Created November 28, 2017 12:40
wordpress child theme path to image
<img src="<?php echo get_template_directory_uri(); ?>/img/placeholder.png" />