Skip to content

Instantly share code, notes, and snippets.

View hhefesto's full-sized avatar

Daniel Herrera Rendón hhefesto

View GitHub Profile
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
${cat configuration.nix}
String file contents
-- {-# LANGUAGE DeriveDataTypeable #-}
-- {-# LANGUAGE FlexibleContexts #-}
-- {-# LANGUAGE GADTs #-}
-- {-# LANGUAGE GeneralizedNewtypeDeriving #-}
-- {-# LANGUAGE MultiParamTypeClasses #-}
-- {-# LANGUAGE OverloadedStrings #-}
-- {-# LANGUAGE QuasiQuotes #-}
-- {-# LANGUAGE TemplateHaskell #-}
-- {-# LANGUAGE TypeFamilies #-}
-- {-# LANGUAGE ScopedTypeVariables #-}
@hhefesto
hhefesto / Foundation.hs
Last active March 19, 2019 04:05
On line 335 verurl should be interpreted as Text, but it reads it as [Element Text]. If I remove the type signature of sendVerifyEmail, it interprets it as [Element VerUrl]
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE InstanceSigs #-}
@hhefesto
hhefesto / nix-daemon.sh
Created January 2, 2019 02:38
cat /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
# Only execute this file once per shell.
if [ -n "${__ETC_PROFILE_NIX_SOURCED:-}" ]; then return; fi
__ETC_PROFILE_NIX_SOURCED=1
# Set up secure multi-user builds: non-root users build through the
# Nix daemon.
if [ "$USER" != root -o ! -w /nix/var/nix/db ]; then
export NIX_REMOTE=daemon
fi
data SupportData = SupportData
{ issues :: [Maybe (Entity Issue)]
, customer :: Maybe (Entity Customer)
, followUps :: [Entity FollowUp]
, customerFollowUps :: [(Entity FollowUp, Entity Customer)]
}
getSupportRData :: CustomerId -> Handler SupportData
getSupportRData customerId = do
issue_mfollowUp_customer_list :: [(Entity Issue, Maybe (Entity FollowUp), Entity Customer)] <- runDB $
@hhefesto
hhefesto / Support.hs
Created November 26, 2018 23:16
not an expression? Why?
data SupportData = SupportData
{ customer :: Entity Customer
, followUps :: [Entity FollowUp]
, customerFollowUps :: [(Entity FollowUp, Entity Customer)]
}
getSupportRData :: CustomerId -> Handler SupportData
getSupportRData customerId = do
customer_issues_followUps_list <- runDB $
E.select $
from keras.models import Sequential
from keras.layers import Dense
model = Sequential()
model.add(Dense(units=64, activation='relu', input_dim=100))
model.add(Dense(units=10, activation='softmax'))
model.compile(loss='categorical_crossentropy',
optimizer='sgd',
@hhefesto
hhefesto / SupportModal_Compiles.hs
Last active November 5, 2018 23:24
Line 36 breaks my code, and I do not know why :(
supportModalTemplate ::[Maybe (Entity Issue)] -> Maybe (Entity Customer) -> [Entity FollowUp] -> Html ()
supportModalTemplate _ Nothing _ = h2_ "Customer not found :S"
supportModalTemplate issues (Just customer) followUps = do
div_ [ class_ "panel panel-default" ] $ do
div_ [ class_ "panel-heading" ] $ do
h3_ [ class_ "panel-title" ] $ "Support"
div_ [ class_ "panel-body" ] $ do
div_ [ class_ "list-group" ] $ do
forM_ issues $ \issue -> case issue of
Nothing ->