Skip to content

Instantly share code, notes, and snippets.

View u840903's full-sized avatar
💭
(╯°□°)╯︵ ┻━┻

Jan K. Griffioen-Järfalk u840903

💭
(╯°□°)╯︵ ┻━┻
View GitHub Profile
const CommonTranslations = {
COMMON_SUBMIT: "SUBMIT",
COMMON_WELCOME: "WELCOME {{username}}",
} as const;
const StartPageTranslations = {
START_PAGE_TITLE: "Startpage",
START_PAGE_ERROR: "Error: {{error}}",
} as const;
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="ie=edge"/><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/><style data-href="/styles.494db61b6ee6b0adfe5f.css">.comments-module--comments--23mG5{padding:91.125px}.comments-module--comments--23mG5 h1{text-transform:uppercase;font-family:sans-serif;font-size:12px}.comments-module--comment--29KbI{font-size:18px;line-height:1.5em;margin-bottom:136.6875px;display:block}.comments-module--comment--29KbI p{max-width:540px}.comments-module--comment--29KbI h1,.comments-module--comment--29KbI h2,.comments-module--comment--29KbI h3,.comments-module--comment--29KbI pre{font-size:18px}.comments-module--header--3yRmu{display:block;text-transform:uppercase;font-family:sans-serif;font-size:12px}.comments-module--user--1iX8T{font-weight:700;color:#000}body,html{margin:0;padding:0;width:100%;height:100%}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:1em}.index-module--page--3hrmN{padding-bottom:91.12
@u840903
u840903 / 500.js
Last active February 18, 2020 00:09
function cropToSelection(top, left, bottom, right) {
var idCrop = charIDToTypeID("Crop");
var desc11 = new ActionDescriptor();
var idT = charIDToTypeID("T ");
var desc12 = new ActionDescriptor();
{
"data": {
"navigation": {
"mainMenu": [
{
"children": [
{
"images": null,
"children": [],
"title": "Rea",
import React from "react";
import { END } from "redux-saga";
const STORE_KEY = "__NEXT_REDUX_STORE__";
export const withReduxSaga = makeStore => {
const isServer = typeof window === "undefined";
const initStore = ({ initialState, ctx }) => {
const createStore = () =>
@u840903
u840903 / lodash_ramda.js
Created January 3, 2019 15:04
Lodash --> Ramda
const user = {
name: {
forename: 'Jan',
surname: 'Jarfalk'
},
age: 34,
friends: ['Peter','Bjorn','John', '']
};
// Get --> Prop, Path, Lens*
// Setup.
const ARRAY_LENGTH = 8;
const STEPS = [
[1, 1, 8],
[0, 2, 8],
[2, 4, 6],
[0, 5, 6]
];
// Initial array state.
@u840903
u840903 / ieee-754-floating-point.js
Last active November 10, 2021 05:50
IEEE-754 Floating Point in Javascript
const pad = (str, n, a=0) => Array.from({length:n-str.length}).map(_ => a).join('') + str;
const nextPowerOf2 = (n) => Math.pow(2, Math.round(Math.max(n,0)).toString(2).length);
const getPowerOfTwoWindow = n => {
const next = nextPowerOf2(n);
return [next/2, next];
};
const floatToBinary = (n) => {
const sign = n > 0 ? 0 : 1;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
const a = 5
const b = 10
const c = a + b
[1, 2, 3].forEach((e) => console.log(e))