Skip to content

Instantly share code, notes, and snippets.

@joakin
joakin / ResponsiveVector.css
Created April 30, 2020 17:27
Responsive vector user style
textarea { font-size: 1em; }
.skin-vector #content>* {
max-width: 800px;
margin-left: auto;
margin-right: auto;
}
@media (max-width: 768px) {
/* Make it flex to change the order of the menus to the top */
@joakin
joakin / wikipedia-multi-language-web-application.md
Created August 26, 2019 12:16
WP PWA - My tries over the years

2015

  • 2015 WM Hackathon: First time I tried to convince people by coding a prototype of a web app in (the presentation seemed to excite people a lot)

I wasn't able to get support for pursuing this so I tried to prepare more information and a more serious project that end of year and start in 2016.

2016

@joakin
joakin / mobile-html-wrapper.html
Created August 21, 2019 16:33
PCS mobile-html HTML file wrapping with an iframe
<!DOCTYPE html>
<html>
<head>
<style>
html,
body {
margin: 0;
padding: 0;
}
body {
@joakin
joakin / parallel.sh
Created August 12, 2019 11:15
Parallel killable bash jobs
#!/bin/bash
trap "exit" INT TERM ERR
trap "kill 0" EXIT
./someProcessA &
./someProcessB &
wait
@joakin
joakin / Type inference.md
Created July 21, 2019 07:49
Type inference lecture notes
@joakin
joakin / MapAndFoldBenchmark.elm
Created July 15, 2019 14:06
Mapping and making lists Benchmark
mapList =
let
xs =
List.range 0 1000 |> List.map (always 0)
in
benchmark "List.map"
(\_ ->
xs |> List.map (always 1)
@joakin
joakin / Benchmark.elm
Created July 15, 2019 08:38
Elm associative data structures benchmark
updateRecord =
benchmark "Update record with native syntax"
(\_ ->
let
surname =
emptyRecord.surname
in
{ emptyRecord | surname = surname ++ "wat" }
)
@joakin
joakin / how-to-use-x-at-work.md
Last active February 12, 2019 11:45
How to use X at work

How to Use X at Work

Adapted from the wonderful original post: How to Use Elm at Work by Evan Czaplicki / 11 July 2016

Removed some Elm specific parts, and made Elm generic as X.

Trying X in some big JavaScript project is not very hard. Why try X like this? Well, tons of folks are trying out X these days, and as they share their

@joakin
joakin / queue-bulk.test.js
Created December 17, 2018 18:33
Bulk test that fails because JobTimeout doesn't kickstart the queue again
"use strict";
const assert = require("../utils/assert.js");
const { Queue } = require("../../lib/queue");
const errors = require("../../lib/errors");
const { QueueItem } = require("../../lib/queueItem");
const logger = { log: (level, data) => {} };
const BBPromise = require("bluebird");
BBPromise.config({
cancellation: true
@joakin
joakin / CurrentWithPipes.elm
Last active September 15, 2018 16:53
Elm canvas api examples
view ( count, fps ) =
Canvas.toHtml
( w, h )
[ Attributes.style "border" "2px solid red" ]
[ shapes [ rect ( 0, 0 ) w h ] |> fill Color.white
, shapes
[ rect ( -100, -150 ) 40 50
, circle ( 100, 100 ) 80
]
|> lineWidth 5