Skip to content

Instantly share code, notes, and snippets.

View Denommus's full-sized avatar

Yuri Albuquerque Denommus

  • Brick Abode
  • Florianópolis, SC, Brazil
View GitHub Profile
clock-0.7.2: configure
clock-0.7.2: build
network-2.6.3.2: configure
old-time-1.1.0.3: download
foundation-0.0.15: configure
foundation-0.0.15: build
old-time-1.1.0.3: configure
Progress: 4/84
-- While building package old-time-1.1.0.3 using:
/tmp/stack13341/old-time-1.1.0.3/.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0/setup/setup --builddir=.stack-work/dist/x86_64-linux-tinfo6-nopie/Cabal-1.24.2.0 configure --with-ghc=/home/yuri/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/bin/ghc --with-ghc-pkg=/home/yuri/.stack/programs/x86_64-linux/ghc-tinfo6-nopie-8.0.2/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/home/yuri/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.6/8.0.2/pkgdb --libdir=/home/yuri/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.6/8.0.2/lib --bindir=/home/yuri/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.6/8.0.2/bin --datadir=/home/yuri/.stack/snapshots/x86_64-linux-tinfo6-nopie/lts-9.6/8.0.2/share --libexecdir=/home/yuri/.stack/snapshots/

Yuri da Costa Albuquerque

{ pkgs ? import <nixpkgs> {} }:
let
stdenv = pkgs.stdenv;
lib = stdenv.lib;
python = import ./requirements.nix { inherit pkgs; };
# The filter function will be used bellow by filterSource
filter = path: type: let baseName = baseNameOf (toString path); in
!(lib.hasSuffix ".sqlite3" baseName) &&
!(lib.hasSuffix ".log" baseName) &&
import React, { Component } from 'react';
import Rx, { Subject, Observable } from 'rxjs';
import { connect, combineProps } from 'rx-react-container';
import logo from './logo.svg';
import './App.css';
class AppComponent extends Component {
render() {
return (
<div>
user auctions;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
type (_, _) wire =
| WArr: ('a -> 'b) -> ('a, 'b) wire
| WConst: 'b -> (_, 'b) wire
| WGen: ((unit -> float) -> 'a -> 'b * ('a, 'b) wire) -> ('a, 'b) wire
| WId: ('a, 'a) wire
@Denommus
Denommus / trilegals.hs
Created March 21, 2016 17:57
List every trilegal number
trilegals :: [Int]
trilegals = filter isTrilegal [100..1000]
isTrilegal :: Int -> Bool
isTrilegal n
| n < 100 || n > 999 = False
| otherwise = u - d == (d - c)*3
where [c, d, u] = map (read . (:"")) (show n) :: [Int]
@Denommus
Denommus / config.nix
Created December 15, 2015 19:08
My nix configuration
{
allowUnfree = true;
packageOverrides = pkgs: with pkgs; {
idea = recurseIntoAttrs (callPackages <nixpkgs/pkgs/applications/editors/idea> {
jdk = oraclejdk8;
androidsdk = androidsdk_4_4;
});
};
}
@Denommus
Denommus / liftErrorIO.hs
Created November 24, 2015 19:50
Type-safe exceptions with monad transformers
import Control.Monad.Except
import Control.Exception (Exception (..), try)
liftErrorIO :: (Exception e, MonadIO m, MonadError e m) => IO a -> m a
liftErrorIO = liftIO . try >=> either throwError return
liftedBracket :: (Exception e, MonadIO m, MonadError e m) => m a -> (a -> m b) -> (a -> m c) -> m c
liftedBracket acquire release comp = do
resource <- acquire
result <- catchError (comp resource) (\e -> release resource >> throwError e)
@Denommus
Denommus / astar.hs
Last active October 19, 2015 15:14
Implementation of the A* algorithm for Haskell
import qualified Data.Set as S
import Data.Map (Map)
import qualified Data.Map as M
reconstructPath :: Ord a => Map a a -> a -> [a]
reconstructPath cameFrom end = helper end [end]
where helper current total = case M.lookup current cameFrom of
Just v -> helper v (v:total)
Nothing -> total