Skip to content

Instantly share code, notes, and snippets.

Avatar

Björn Söderqvist cybear

  • Greenfield AB
  • Malmo, Sweden
View GitHub Profile
@cybear
cybear / Why you should learn gh actions.md
Last active Apr 30, 2020
Frontenders: This is why you should learn Github Actions
View Why you should learn gh actions.md

Intro / pitch

  • My code broke the live site. Why didn't it do what I intended for it to do? How did it get all the way to production?

You're probably a frontend developer like me.

In this article I will try to convince you that you should learn to automate some actions for your repo.

Feedback cycles

View hire-me.md

Hire me - Raise your frontend to a whole new level

I'm looking for a new gig (contractor / consultant).

Location: Malmö or Lund

Start: August

Some examples of what I can do:

@cybear
cybear / placeholder.svg.js
Created May 6, 2019
SVG image placeholder with correct dimensions and background color
View placeholder.svg.js
const prefix = "data:image/svg+xml,";
export default props =>
prefix +
encodeURI(`
<svg
xmlns='http://www.w3.org/2000/svg'
viewBox='0 0 ${props.width} ${props.height}'>
<rect
height='100%'
View dl.sh
#!/bin/bash
while read path
do
mkdir -p "$path"
svtplay-dl -MAts -o "$path/" "https://www.svtplay.se/$path" &
sleep 15
done < $1
@cybear
cybear / dl.sh
Last active Oct 9, 2017
SVT Play download all episodes of all shows
View dl.sh
#!/bin/bash
while read path
do
mkdir -p "$path"
svtplay-dl -MAts -o "$path/" "https://www.svtplay.se/$path" &
done < $1
View keybase.md

Keybase proof

I hereby claim:

  • I am cybear on github.
  • I am tap5 (https://keybase.io/tap5) on keybase.
  • I have a public key whose fingerprint is 3D08 BBDC CF72 E40B A709 BDCE C2B7 BD65 1385 D7A3

To claim this, I am signing this object:

@cybear
cybear / error-messages.md
Created Mar 10, 2015
Writing tips for error messages
View error-messages.md

Writing tips for error messages

  • Describe the cause of the error, if possible.
  • Avoid blaming the user. "You typed a URL that doesn't exist" => "We can't find any page at this URL"
  • Avoid impersonal writing. "Could not upload selected files" => "We could not upload the files that you selected"
  • Suggest a next action for the user if it is plausible.
@cybear
cybear / colors.html
Created Oct 9, 2014
one-color.js and js arrays in chrome dev console
View colors.html
<html>
<head>
<title>Color development console</title>
<script src="http://cdn.jsdelivr.net/one-color/2.4.0/one-color-all.js"></script>
<script type="text/javascript">
function logColor(oneColor) {
var c = oneColor.hex();
console.log( '%c'+c, 'background:' + c);
return oneColor;
}
@cybear
cybear / ios-simulator-cache-buster.sh
Created Aug 14, 2014
iOS Simulator cache buster
View ios-simulator-cache-buster.sh
#!/bin/sh
killall "iPhone Simulator"
folder="/Users/cybear/Library/Application\ Support/iPhone\ Simulator/7.1"
rm -rf $folder/Media/PhotoData/Caches
rm -rf $folder/Media/PhotoData/Thumbnails
rm -rf $folder/tmp
rm -rf $folder/Library/Cookies
rm -rf $folder/Library/TCC
rm -rf $folder/Library/Passes
rm -rf $folder/Library/Calendar
@cybear
cybear / gist:bdf357186de14d44cd97
Created May 14, 2014
Demodag hilite demoing people
View gist:bdf357186de14d44cd97
Array.prototype.slice.call (document.querySelectorAll('tr'),0)
.filter(function(el){
var c = el.querySelector('.class_7');
return c&&c.innerText;
})
.map(function(el){
el.setAttribute('style','background:#fff');
return el;
});
You can’t perform that action at this time.