This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
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 | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE FlexibleContexts, ScopedTypeVariables, TypeApplications, TypeFamilies #-} | |
module EvilList where | |
import Data.Typeable | |
type family EvilListContent a where | |
EvilListContent Int = () | |
EvilListContent a = a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/usr/env bash | |
# Originaly from: https://www.reddit.com/r/NixOS/comments/5yxt45/simple_nix_package_search/ | |
nq () { | |
local CACHE="$HOME/.cache/nq-cache" | |
if ! ( [ -e $CACHE ] && [ $(stat -c %Y $CACHE) -gt $(( $(date +%s) - 3600*24*7 )) ] ); then | |
# read gotcha.. can't pipe to read (as usual zsh beats bash) | |
read x MEM_AVAIL_KB UNIT < <(grep MemAvailable: /proc/meminfo) | |
if [[ $UNIT != "kB" || $MEM_AVAIL_KB -lt 1000000 ]]; then | |
# nix-env can easily use up to 1GB during -qa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
module Run ( | |
runner | |
) where | |
import Control.Monad.Reader (ReaderT, runReaderT) | |
import Data.Foldable (traverse_) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:set prompt "> " | |
:set -isrc | |
:load Main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# 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) |
NewerOlder