×

Responsive youtube background limited to div with content on top

Published januar 23rd, 2018 by

See the Pen Responsive youtube background limited to div with content on top by Morten Skogly (@mskogly) on CodePen.

Posted in Code

CSS3 background patterns inspired by Yayoi Kusama

Published januar 17th, 2018 by

(mer…)

Posted in Code

Quickest way to poll a changing json and update a row in a Google spreadsheet

Published november 29th, 2017 by

Aka "a poor mans database".

A user asked for a playlist for one of our streaming radiochannels. We have no official playlist for that channel, and being pressed for time I hastily created a Google Spreadsheet and added a simple script for polling a json-script. It uses Google's inbuilt trigger solution for running the script every five minute. The script lacks any checks and failsafes and is meant for demo purposes.


(mer…)

Posted in Code

ReMorten v0.1 – Part 1

Published august 23rd, 2017 by

The ReMorten Project: A telepresence robot platform using nodejs running on the Raspberry Pi. Because why not.

(mer…)

Posted in Code, Projects

Linking to a spotify search with both track and artist

Published februar 16th, 2017 by

It seems that Spotify has made some changes to how one should format links when performing more complex searches, causing some problems with one of the services I work on. This post describes my solution.
(mer…)

Posted in Code, Webdev

Jetpack JSON Api – outputting custom fields

Published januar 24th, 2017 by

Instead of using rss to retrieve data from a wordpress site I wanted to try out the Jetpack JSON API, aka WordPress Rest api. I came across some smallish challenges, so just wanted to write a quick post with the solution for those getting stuck on the same.
(mer…)

Posted in Code

Drawing with JS part 1

Published januar 14th, 2017 by

A few experiments using javascript to draw or generate graphics.


Rune.js

Via http://printingcode.runemadsen.com/examples/

See the Pen Rune.js 3 Manipulates the outline of a polygon by changing the position of its vectors. by Morten Skogly (@mskogly) on CodePen.

See the Pen Rune.js 8 Loop by Morten Skogly (@mskogly) on CodePen.

See the Pen Rune.js 4 Noise by Morten Skogly (@mskogly) on CodePen.

See the Pen Rune.js 5 Pintori Noise by Morten Skogly (@mskogly) on CodePen.

Autoruns, generates random polygon. Click rerun to … rerun.

See the Pen Rune by Morten Skogly (@mskogly) on CodePen.


Via http://printingcode.runemadsen.com/lecture-form-2/
Documentation: http://runemadsen.github.io/rune.js/documentation.html

See the Pen Rune.js 2 by Morten Skogly (@mskogly) on CodePen.


Vanilla js using canvas, via https://javascript30.com/

Click and drag to draw.

See the Pen Html5 canvas – Drawing 1 by Morten Skogly (@mskogly) on CodePen.

See the Pen Html5 canvas – Drawing 2 by Morten Skogly (@mskogly) on CodePen.

Posted in Art, Code, Testing

Default startup page on Ubuntu guest session

Published november 19th, 2015 by

I’ve been setting up some salvaged laptops for a local refugee center, running linux, and wanted to open a webpage automatically with useful information when a user logs on as guest. I did some googling, but found the explanations pretty confusing and convoluted.

The solution is pretty simple, when you first figure it out. This is how I did it on my laptops, running Ubuntu 15.10. (It should also work from Ubuntu 14.04):

1. Log in as admin, and start the terminal and enter the /etc directory by typing cd /etc.
2. Create the directory guest-session, by typing sudo mkdir guest-session. Enter the dir by typing cd guest-session.
3. Typed sudo gedit auto.sh. This opens the text editor gedit with an empty document. Enter firefox “pappmaskin.no” and save the document. Close gedit.
4. Log in as guest, and the url you wrote should open.

Easy!

Posted in Code, Open Source, Repair the planet

Using coauthors plus in your theme

Published januar 1st, 2013 by

Had kind of a hard time trying to find documentation for how to implement coauthor plus in single.php or sidebar.php, so I wanted to share the code I used for p3.no/filmpolitiet

(remove the debug part when you’re finished testing).
Test: https://pappmaskin.no/2013/01/test-coauthors-plus/?debug=1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
 
 
<!-- start coathors kode -->
			<?php 
 
			$debug = 0;
			$debug =  $_GET["debug"];
 
			if (function_exists('get_coauthors') && $debug ==1) {
				echo "Sorry for the mess, site under construction"; 
				$coauthors = get_coauthors(); // $post_id ?
				?>
 
				<?php foreach( $coauthors as $coauthor ) : ?> 
 
				<?php $profilbilde = "";?>
				<div class="author-wrap">
 
				<div class="b_metaboks">
 
				<div class="b_skribent"> <a href="<?php echo site_url(); ?>/author/<?php echo $coauthor->user_login; ?>" title="Les artiklene til <?php echo $coauthor->display_name; ?>"><?php echo $coauthor->display_name; ?></a></div>
 
				<div class="b_epost"><a href="mailto:<?php echo $coauthor->user_email; ?>"><?php echo $coauthor->user_email; ?></a></div>
 
				</div>   
 
				<div class="b_bilde">
				<a href="<?php echo site_url(); ?>/author/<?php echo $coauthor->user_login; ?>" title="">
 
				<?php			 if($coauthor->profilbilde != "") { ?>
					<img alt="" src="<?php echo $coauthor->profilbilde; ?> " class="avatar avatar-100 photo" height="100" width="100"></a> 
					<?php } //end if coauthor profilbilde
 
				else {
 
 
				echo get_avatar($coauthor->user_email, $size = '100', $default = '' );
					//echo get_avatar(get_the_author_meta('user_email') , $size = '100', $default = '' );
 
				} //end else coauthor profilbilde ?>
 
				</div>
				<div style="clear:both;"></div>                                      
				</div> <!-- avslutt .author-wrap -->
 
 
 
				<?php endforeach; //coauthors?>
 
				<?php } //end check function exists get coauthors ?>
			<!-- end coathors kode -->

Posted in Code, Testing

How to make the Get The Image WordPress plugin to work with TimThumb and Related posts

Published mars 27th, 2010 by

I’ve been using the wordpress plugin ‘Get the Image‘ by developer Justin Tadlock for a while. ‘Get the image’ does a fantastic job searching through posts looking for images, so you don’t have to add thumbnails manually, but it always bothered me that it downscaled images in the html instead of scaling and cropping them properly. I also use the lovely timThumb script on my blog, to scale, scrop and cache images on the fly, and I wanted to find a way to combine the two scripts into one.

(mer…)

Posted in Code, Open Source