Add this to devenv.nix
env.NIX_CFLAGS_COMPILE = "-I ${libxml2.dev}/include/libxml2"
import React, { useRef, useEffect } from "react"; | |
import ReactDOM from "react-dom"; | |
export default function Portal (props) { | |
const elRef = useRef(document.createElement("div")); | |
const rootRef = useRef(); | |
useEffect(() => { | |
rootRef.current = document && document.getElementById("portal-root"); | |
rootRef.current && rootRef.current.appendChild(elRef.current); |
import React, { useRef, useEffect } from "react"; | |
import ReactDOM from "react-dom"; | |
export function LandingPad() { | |
return <div id="portal-root" />; | |
} | |
export function Portal (props) { | |
const elRef = useRef(document.createElement("div")); | |
const rootRef = useRef(); |
import React from "react"; | |
import { Portal } from "./Portal"; | |
export default function FlashMessage() { | |
return ( | |
<Portal> | |
<div class="alert alert-primary" role="alert"> | |
This is a special announcement, be sure and read it! | |
</div> |
import React from "react"; | |
import { LandingPad } from "./Portal"; | |
export default function Article() { | |
return ( | |
<div> | |
<LandingPad /> | |
<h1>Here is a latin article</h1> | |
<p> |
apt-get update && apt-get install -y \ | |
build-essential \ | |
autoconf \ | |
automake \ | |
libtool \ | |
intltool \ | |
gtk-doc-tools \ | |
unzip \ | |
wget \ | |
git \ |
const rules = require('./webpack.rules'); | |
const plugins = require('./webpack.plugins'); | |
rules.push({ | |
test: /\.css$/, | |
use: ['style-loader', 'css-loader', 'postcss-loader'], | |
}); | |
module.exports = { | |
module: { |
<?php | |
function format_as_currency( $amount ) { | |
return '$' . number_format( $amount, 2 ); | |
} | |
function get_sales_by_year( $orders ) { | |
$sales_by_year = array(); | |
foreach ( $orders as $order_id ) { |
Add this to devenv.nix
env.NIX_CFLAGS_COMPILE = "-I ${libxml2.dev}/include/libxml2"
mkdir hello_world
cd hello_world
devenv init
devenv inputs add nixpkgs-ruby github:bobvanderlinden/nixpkgs-ruby --follows nixpkgs
direnv allow .
echo ruby-3.3.6 > .ruby-version
(use most recent version of Ruby){ pkgs, lib, config, inputs, ... }: