theoddler / elmder Goto Github PK
View Code? Open in Web Editor NEWTrying out some elm stuff
Trying out some elm stuff
This is part of the impressions, but isn't actually used yet.
Currently I just store latitude and longitude. Use postgis instead for better indexing, but see if it works with Hasql.
Currently we just use simpleCors
(https://hackage.haskell.org/package/wai-cors-0.2.7/docs/Network-Wai-Middleware-Cors.html#v:simpleCors)
I saw your code and it helped me solve my problem. Thanks! Here's the final version:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
mkElmDerivation.url = github:jeslie0/mkElmDerivation;
};
outputs = { self, flake-utils, nixpkgs, mkElmDerivation }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ mkElmDerivation.overlays.mkDotElmDirectoryCmd ];
};
elmParcelNixFix = {
# To make Elm, Parcel and Nix work together we need do some some fixes:
# 1. The Elm node package tries to download the binary when installing, this doesn't work in Nix's sandbox, so instead we add it to the nativeBuildPackages, set the npmFlag to not run install scripts, and alter this (https://github.com/elm/compiler/blob/047d5026fe6547c842db65f7196fed3f0b4743ee/installers/npm/bin/elm#L8-L30) script to instead of downloading the binary to just use the one we installed as the native build package
nativeBuildPackages = [ pkgs.elmPackages.elm ];
npmFlags = [ "--ignore-scripts" ];
preBuild = ''
substituteInPlace node_modules/.bin/elm \
--replace 'var binaryPath = path.resolve' 'var binaryPath = "${pkgs.lib.getExe (pkgs.elmPackages.elm // {meta.mainProgram="elm";})}"; runCommand(); return; //'
'';
# 2. Generate the .elm directory
generateElmJsonFiles = pkgs.mkDotElmDirectoryCmd ./elm.json;
};
buildInputs = with pkgs; [
elmPackages.elm
elmPackages.elm-live
elmPackages.elm-test
elmPackages.elm-format
nodejs-18_x
];
in
{
packages.default = self.packages.${system}.frontend;
packages.frontend = pkgs.buildNpmPackage {
name = "parceljs-with-elm-and-nix";
src = ./.;
nativeBuildInputs = elmParcelNixFix.nativeBuildPackages;
npmFlags = elmParcelNixFix.npmFlags;
npmPackFlags = [ "--ignore-scripts" ]; # The prepack script runs the build script, which we'd rather do in the build phase.
prePatch = elmParcelNixFix.generateElmJsonFiles;
# preConfigure = elmParcelNixFix.generateElmJsonFiles; # seems you can do either prePatch or preConfigure (maybe others? IDK -- I'm new to this)
preBuild = elmParcelNixFix.preBuild;
npmDepsHash = "sha256-Lpj6we8KXfdFNEQpWxeLwX0vTPeZRV0B5oRoh9Ur+y4=";
# npmDepsHash = lib.fakeHash;
npmBuild = "npm run build";
installPhase = ''
mkdir $out
cp -R dist_prod/* $out/
'';
};
devShells.default = pkgs.mkShell {
inherit buildInputs;
};
}
);
}
At the moment I just have these placeholder profile sections. Either add those to the DB, or rework what a profile looks like altogether.
At the moment each column used in search has it's own index. Consider making a combined index for better performance.
I probably want to make something to actually tests these queries on millions of users first though.
NOT EXISTS FROM impressions
Include indicator of new/unread messages
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.