Skip to content

Instantly share code, notes, and snippets.


Lucian Ursu LucianU

View GitHub Profile
View conversations-with-gpt3
I primed it to respond to my questions as Nisargadatta... only slightly edited for your enjoyment. Enjoy! and let me know if you want me to ask it any questions! 😊
Mark: i have read some of your teachings, and i find them compelling. Yet I find myself daily embroiled in a struggle. How can I realize the true self?
Nisargadatta: This is the problem of man. Man cannot attain to the Self, because he does not know what it is. But you must learn, if you wish to be free.
Mark: what is the true self?
Nisargadatta: There is no way to tell you. You will have to find out yourself. You are the Self and you are not the Self. The Self is unfathomable. It is not your intellect, nor your mind, nor anything you can acquire.
View server.nix
nixpkgs = builtins.fetchTarball {
name = "nixos-20.03";
url = "";
sha256 = "0f3s0m3bdd857s7zrgghl6vmj3hjqfaqcnd7sg33fzwakagwy0fp";
nixos = import "${nixpkgs}/nixos" {
configuration = {
imports = [
View configuration.nix
{ config, pkgs, lib, ... }:
knowledgeStorePort = 8080;
publicWikiPort = 9000;
imports = [
./networking.nix # generated at runtime by nixos-infect
LucianU / DevelMain.hs
Created Jul 16, 2019
Example DevelMain.hs which uses foreign-store
View DevelMain.hs
-- | Running your app inside GHCi.
-- To start up GHCi for usage with Yesod, first make sure you are in dev mode:
-- > cabal configure -fdev
-- Note that @yesod devel@ automatically sets the dev flag.
-- Now launch the repl:
-- > cabal repl --ghc-options="-O0 -fobject-code"
LucianU / shell.nix
Created Jul 16, 2019
Example shell.nix for working with Yesod
View shell.nix
compiler = "ghc843";
config = import ./pkgconfig.nix { inherit compiler; };
pkgs = import (import ./nixpkgs.nix) { inherit config; };
hpkgs = pkgs.haskell.packages.${compiler};
pkg = hpkgs.callPackage (import ./riskbook.nix) {};
{}: pkgs.lib.overrideDerivation pkg.env (old: {
buildInputs = old.buildInputs ++ [
LucianU / .ghci
Created Jul 16, 2019
Example .ghci for yesod projects
View .ghci
:set -i./src:./test
:set -fobject-code
:set -O0
:set +s
:set -freverse-errors
:set -Wall
:set -Wincomplete-uni-patterns
:set -Wincomplete-record-updates
:set -Widentities
View Payments.purs
approveOtp ::
Session ->
approveOtp (Session session) = let approveOtpV = execState (do
modify_ ((\{ approved } ->
{ approved: "F"
if Array.any (\(Event e) ->
String.toLower (fromMaybe "null" e.label) == "approve_otp")
then modify_ ((\{ approved } ->
View syntaxError.hs
userLogin :: EitherIO LoginError Text
userLogin = do
token <- getToken
userpw <- maybe (liftEither (Left NoSuchUser))
return (Map.lookup token users)
password <- liftIO (
T.putStrLn "Enter your password:" >>
View fromIndex.hs
fromIndex :: Int -> [a] -> Maybe a
fromIndex 0 (x:xs) =
Just x
fromIndex index [] =
fromIndex index (x:xs) =
fromIndex (index - 1) xs
View compose.hs
newtype Identity a =
Identity { runIdentity :: a }
deriving (Eq, Show)
newtype Compose f g a =
Compose { getCompose :: f (g a) }
deriving (Eq, Show)
instance (Functor f, Functor g) =>
Functor (Compose f g) where
You can’t perform that action at this time.