Skip to content

Instantly share code, notes, and snippets.

@Wizek
Wizek / stress-memory-1.js
Last active August 19, 2020 14:23 — forked from Eomm/stress-memory.js
Check when your server goes out of memory
/**
node --max-old-space-size=4048 --initial-old-space-size=4048 --max-heap-size=4048 stress-memory-1.js
x64
rss 7.62 GB
heapTotal 3.74 GB
heapUsed 3.73 GB
*/
@Wizek
Wizek / EvilList.hs
Created October 8, 2018 12:19 — forked from ion1/0readme.md
Emulating the elegance of JavaScript's `new Array` in Haskell
{-# LANGUAGE FlexibleContexts, ScopedTypeVariables, TypeApplications, TypeFamilies #-}
module EvilList where
import Data.Typeable
type family EvilListContent a where
EvilListContent Int = ()
EvilListContent a = a
@Wizek
Wizek / Bag.purs
Created May 3, 2018 10:06 — forked from i-am-tom/Bag.purs
PureScript port of Will Jones' type-indexed config "bag".
module Main where
import Control.Alternative ((<|>))
import Control.Apply (lift2)
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE, logShow)
import Data.Argonaut.Core (Json)
import Data.Argonaut.Decode (class DecodeJson, decodeJson)
import Data.Argonaut.Encode (class EncodeJson, encodeJson)
import Data.Either (hush)
@Wizek
Wizek / NamedDefaults.hs
Created April 24, 2018 06:16 — forked from int-index/NamedDefaults.hs
named-defaults
{-# LANGUAGE KindSignatures, DataKinds, FlexibleInstances, FlexibleContexts,
FunctionalDependencies, TypeFamilies, TypeOperators,
PatternSynonyms, UndecidableInstances, ConstraintKinds,
TypeApplications, ScopedTypeVariables, CPP #-}
module NamedDefaults (FillDefaults, fillDefaults, (!.)) where
import Prelude (Maybe(..), id)
import Data.Kind (Type)
@Wizek
Wizek / nix-package-search
Created December 3, 2017 04:07 — forked from olejorgenb/nix-package-search
nix-package-search
@Wizek
Wizek / backblaze b2 backup script
Created August 29, 2017 23:10 — forked from scottlinux/backblaze b2 backup script
Backup script for backblaze b2
#!/usr/bin/env bash
#
# Backup selected directories to a Backblaze B2 bucket
#
# Example daily cron:
# @daily /usr/local/bin/b2backup >/dev/null
#
# Account creds
id=xxxxxxxxxx
@Wizek
Wizek / Run.hs
Created August 19, 2017 16:48 — forked from dalaing/Run.hs
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE OverloadedStrings #-}
module Run (
runner
) where
import Control.Monad.Reader (ReaderT, runReaderT)
import Data.Foldable (traverse_)
@Wizek
Wizek / .ghci
Created August 19, 2017 16:46 — forked from 3noch/.ghci
Reflex-DOM Auto Reload Development with ghcid
:set prompt "> "
:set -isrc
:load Main
@Wizek
Wizek / a.txt
Created August 19, 2017 10:56 — forked from lspitzner/a.txt
sublime3+ghcid setup for quick haskell coding feedback
sublime3 and ghcid setup for quick haskell coding feedback
tested on sublime 3
(you can omit the SublimeOnSaveBuild steps, as the result is not
completely reliable anyways. i still find it useful, though.)
steps:
- install https://github.com/lspitzner/SublimeOnSaveBuild
(original from alexnj; in his/her version the build-window gets closed
@Wizek
Wizek / somesquares.hs
Created August 15, 2017 14:52 — forked from ali-abrar/somesquares.hs
Simple Canvas Example
{-# LANGUAGE ScopedTypeVariables #-}
import Reflex.Dom
import GHCJS.DOM.CanvasRenderingContext2D (putImageData, setFillStyle, fillRect)
import GHCJS.DOM.HTMLCanvasElement (getContext)
import GHCJS.DOM.ImageData (newImageData')
import Control.Monad.IO.Class (liftIO)
import GHCJS.DOM.Types (CanvasStyle(..), CanvasRenderingContext2D(..), toJSString, castToHTMLCanvasElement)
import GHCJS.Marshal (toJSVal)
import Data.Time (getCurrentTime)