Skip to content

Instantly share code, notes, and snippets.

View eclipsed_default.hideout
{
"version": 1,
"language": "English",
"hideout_name": "Eclipsed Hideout",
"hideout_hash": 37028,
"environment": 0,
"doodads": {
"Stash": {
"hash": 3230065491,
"x": 579,
View Interaction.hs
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE OverloadedStrings #-}
module Interaction where
import Conduit
import Data.Conduit.Process.Typed
import qualified Data.Text.IO as Text (putStr, putStrLn)
import RIO
import qualified RIO.Text as Text
View json-edit.hs
#!/usr/bin/env stack
-- stack --resolver lts-13.15 script
{-# LANGUAGE OverloadedStrings, NoImplicitPrelude #-}
import Language.Haskell.Interpreter
import Options.Applicative.Simple
import Protolude hiding (to)
import Prelude (String)
import Control.Lens hiding (set)
import Data.Aeson
@madjar
madjar / mkLazyBin.nix
Created Jan 16, 2019
Lazy binaries, that install the underlying command on invocation (the missing part is a gc root)
View mkLazyBin.nix
with import <nixpkgs> {};
let
mkLazyBin = { pkg, bin }:
writeTextFile {
name = bin;
executable = true;
text = ''
#!/bin/sh
[[ -d ${builtins.unsafeDiscardStringContext (pkg.outPath)} ]] || nix build --no-link ${builtins.unsafeDiscardStringContext (pkg.drvPath)}
${builtins.unsafeDiscardStringContext (pkg.outPath)}/bin/${bin}
View jsonToDhall.hs
#!/usr/bin/env stack
-- stack --resolver nightly-2018-11-30 script
{-# LANGUAGE OverloadedStrings #-}
import Data.Aeson
import Data.Aeson.Encode.Pretty (encodePretty)
import Dhall
import Dhall.Core
import Dhall.Parser (Src)
import Dhall.TypeCheck (X)
View pipelineDSL.scala
import org.apache.spark.ml.PipelineStage
import org.apache.spark.ml.feature.{OneHotEncoder, VectorAssembler, StringIndexer}
import org.apache.spark.mllib.linalg.VectorUDT
import scala.Function.const
import scala.language.{implicitConversions, reflectiveCalls}
/* Spark Pipeline API is kind of sad to use, so let's make a nicer, more compositional API!
*/
View fix_translation.py
from pathlib import Path
import sys
import itertools
source = Path(sys.argv[1])
target = Path(sys.argv[2])
if target.exists():
print("%s already exists, aborting." % target)
sys.exit()
View update_kf5.py
import os
from collections import namedtuple
import subprocess
import tarfile
import re
import requests
from bs4 import BeautifulSoup
import jinja2
View update_kf5.py
import os
from collections import namedtuple
import subprocess
import tarfile
import re
import requests
from bs4 import BeautifulSoup
import jinja2
View keybase.md

Keybase proof

I hereby claim:

  • I am madjar on github.
  • I am georges (https://keybase.io/georges) on keybase.
  • I have a public key whose fingerprint is F683 691F D4AE A070 B860 077A D62C 17B1 0DE2 67C2

To claim this, I am signing this object: