Skip to content

Instantly share code, notes, and snippets.

View jksolbakken's full-sized avatar
🤘

Jan-Kåre Solbakken jksolbakken

🤘
View GitHub Profile

Keybase proof

I hereby claim:

  • I am jksolbakken on github.
  • I am jksolbakken (https://keybase.io/jksolbakken) on keybase.
  • I have a public key whose fingerprint is 416E 3CEE 01C2 818A 9770 9088 5B78 EFF2 497F AC73

To claim this, I am signing this object:

function setjdk() {
if [ $# -ne 0 ]; then
removeFromPath '/System/Library/Frameworks/JavaVM.framework/Home/bin'
if [ -n "${JAVA_HOME+x}" ]; then
removeFromPath $JAVA_HOME
fi
export JAVA_HOME=`/usr/libexec/java_home -v $@`
export PATH=$JAVA_HOME/bin:$PATH
fi
}
const pattern = '(CONTENT|content)=["\']0;\s*(URL|url)=(.*?)(["\']\s*>)';
const a = '<META http-equiv="refresh" content="0;url=http://localhost:3000/1">'
const b = '<META http-equiv="refresh" content="0; url=http://localhost:3000/1">'
console.log(a.match(pattern));
console.log(b.match(pattern));
@jksolbakken
jksolbakken / range.js
Created February 21, 2017 10:04
ev range
let maxConsumption = (typicalRange, distance, typicalConsumption) => {
return typicalRange / distance * typicalConsumption;
}
let typicalRange = (desiredConsumption, distance, typicalConsumption) => {
return desiredConsumption * distance / typicalConsumption;
}
@jksolbakken
jksolbakken / DateStuff.java
Created October 3, 2016 17:46
Create a LocalDate from year, week nr and day of week
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.Year;
import java.time.temporal.IsoFields;
import java.time.temporal.TemporalAdjusters;
public class DateStuff {
public static void main(String[] args) {
int weekNr = 51;