Skip to content

Instantly share code, notes, and snippets.

View pablo-abc's full-sized avatar

Pablo Berganza pablo-abc

View GitHub Profile
@pbostrom
pbostrom / cljs-npm.md
Last active March 8, 2024 07:53
Loading third-party npm modules in ClojureScript

Loading third-party npm modules in ClojureScript

This example shows how to load the re-resizable npm module which provides a resizable React component. Requires the lein-npm plugin.

  1. Add the npm module to the :npm :dependencies section of project.clj:
 :npm {:package {:scripts {:build "webpack -p"}}
       :dependencies [[react "16.4.0"]
                      [react-dom "16.4.0"]
                      ["@cljs-oss/module-deps" "1.1.1"]
@cereallarceny
cereallarceny / index.js
Last active May 2, 2023 06:41
Server-side rendering in Create React App
const md5File = require('md5-file');
const path = require('path');
// CSS styles will be imported on load and that complicates matters... ignore those bad boys!
const ignoreStyles = require('ignore-styles');
const register = ignoreStyles.default;
// We also want to ignore all image requests
// When running locally these will load from a standard import
// When running on the server, we want to load via their hashed version in the build folder
@growdigital
growdigital / html.html
Created July 13, 2017 14:22
All HTML elements. Well, most of them…
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>HTML by Adam Morse, mrmrs.cc</title>
</head>
<body>
<header>
<h1>HTML</h1>