Skip to content

Instantly share code, notes, and snippets.

{ config, pkgs, ... }:
{
imports = [ <nixpkgs/nixos/modules/virtualisation/amazon-image.nix> ];
ec2.hvm = true;
# Install some packages
environment.systemPackages =
with pkgs;
[
@fragamus
fragamus / gist:83fee3f6408991284d21969005d6f862
Created April 7, 2018 22:05
source code for web page that I'm trying to automate with powershell
<title>Bizagi</title> <script type='text/javascript' src='jquery/bizagi.configuration.js'></script> <script type='text/javascript' src='jquery/steal.js'></script> <script type="text/javascript"> document.write("<script type='text/javascript' src='jquery/bizagi.loader.js?_=" + new Date().getTime() + "'>");</script> <script type="text/javascript" language="javascript"> // Redefine path to base var session = window.sessionStorage.getItem("bizagiAuthentication") || "{}"; var bizagiConcurrent; session = JSON.parse(session);
var BIZAGI_DEFAULT_CURRENCY_INFO = {
"symbol": session.symbol || "$",
"decimalSeparator": session.decimalSeparator || ",",
"groupSeparator": session.groupSeparator || ".",
"decimalDigits": session.decimalDigits || "2"
};
// Gets the loader instance, and load the module
var loader = bizagi.loader;
@fragamus
fragamus / gist:4d793df549a14fd9db9445562627a34b
Created March 8, 2018 06:53
Compiling neural's Data.FixedSize.Vector Couldn't match type ‘n + 1’ with ‘1 + n’
[12 of 22] Compiling Data.FixedSize.Vector ( src/Data/FixedSize/Vector.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/Data/FixedSize/Vector.o )
/private/var/folders/rl/lpwgmdlj6ld9pljmv6_gj4hh0000gn/T/stack56339/neural-0.3.0.1/src/Data/FixedSize/Vector.hs:104:22: error:
• Couldn't match type ‘n + 1’ with ‘1 + n’
Expected type: Vector (n + 1) a
Actual type: Vector (1 + n) a
NB: ‘+’ is a type function, and may not be injective
• In the expression: Vector $ VS.cons x xs
In an equation for ‘cons’:
cons x (Vector xs) = Vector $ VS.cons x xs
@fragamus
fragamus / gist:400885f10809d35718209c22a24c51ad
Created March 8, 2018 06:19
neural not working in stack build
bash-3.2$ stack build
Building all executables for `malek' once. After a successful build of all of them, only specified executables will be rebuilt.
malek-0.1.0.0: build (lib + exe)
Preprocessing library for malek-0.1.0.0..
Building library for malek-0.1.0.0..
[1 of 2] Compiling Lib ( src/Lib.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/Lib.o )
/Users/michaelgough/malek/malek/src/Lib.hs:12:1: error:
Could not find module ‘Data.MyPrelude’
Use -v to see a list of the files searched for.
@fragamus
fragamus / gist:daecb2f3ec1bd7c6df5e08e5f68aa2e5
Created February 26, 2018 20:54
Trying nix-build -A swift
running 17.09 stable, I did this:
git clone git@github.com:NixOS/nixpkgs.git
cd nixpkgs
nix-build -A swift
And I got this:
/tmp/nix-build-swift-4.0.3.drv-0/src/lldb/include/lldb/Utility/TaskPool.h:122:12: error: no member named 'bind' in namespace 'std'
@fragamus
fragamus / something strange in your neighborhood
Created February 21, 2018 04:33
Warning: something's wrong at /nix/store/vn1xs9s2akf79y1pbya2qldydbf2b22m-setup-etc.pl line 97.
[root@ip-172-31-17-67:~]# nixos-rebuild switch
building Nix...
building the system configuration...
these derivations will be built:
/nix/store/21cbdgb388w46hc804bxj5xbyqqz2lfn-system-path.drv
/nix/store/34yywa3lf9lhxf5m0kgb0cn40fkqjmsi-unit-systemd-fsck-.service.drv
/nix/store/i5cgmwqhxv3k6q76333lib82kbi8z4ck-dbus-catalog.xml.drv
/nix/store/dpmsi0vqypw4fbcrmaf23rgr4bdmhp55-dbus-1.drv
/nix/store/7lw23ggpcgg28m1rd6w5mkbk2blxfgmh-unit-dbus.service.drv
/nix/store/45iipgh9p68zvc52a29366c5zf8lnixh-user-units.drv
[root@ip-172-31-30-159:~]# nix-env -iA nixos.stack
installing ‘stack-1.5.1’
these paths will be fetched (3.47 MiB download, 22.51 MiB unpacked):
/nix/store/959h7dff5saa0k89v1gj73vk6k8vvb3q-stack-1.5.1
fetching path ‘/nix/store/959h7dff5saa0k89v1gj73vk6k8vvb3q-stack-1.5.1’...
*** Downloading ‘https://cache.nixos.org/nar/0xqf7whg0g6cfvkz7y3pgk3h5q5a9vhvs7dfn450fj4a0j4z9sy3.nar.xz’ (signed by ‘cache.nixos.org-1’) to ‘/nix/store/959h7dff5saa0k89v1gj73vk6k8vvb3q-stack-1.5.1’...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3549k 100 3549k 0 0 1774k 0 0:00:02 0:00:02 --:--:-- 1533k
@fragamus
fragamus / gist:6a54eb38952aaeefdf32a5e0636cec11
Last active April 30, 2017 00:19
the counter handled by stateT isn't changing with modify (+1)
#!/usr/bin/env stack
-- stack --install-ghc runghc --package turtle
{-# LANGUAGE OverloadedStrings #-}
import Prelude hiding (FilePath)
import Turtle
import Control.Monad.State
import Data.Text
import Filesystem.Path.CurrentOS
import Data.Either
@fragamus
fragamus / gist:3cc5ab02a9ea89c42111ed7069d7e53b
Created April 27, 2017 20:18
the function "middle" is funky
import Pipes
import Pipes.Core
import Control.Monad
import System.IO
main = runEffect loop
loop = for ((start >~> middle) ()) (lift . putStrLn)
start a = do
@fragamus
fragamus / gist:56e570e2df276de569c68d018d54aaae
Created April 25, 2017 17:50
For some reason i is always 0
filePathPipe :: MonadIO m => Pipe a a m ()
filePathPipe = filePathPipe2 0 where
filePathPipe2 i = do
x <- await
yield x
liftIO $ putStrLn $ show i
if (i `mod` 10 == 0)
then do
liftIO $ putStrLn "TEN"
filePathPipe2 (i+1)