Skip to content

Instantly share code, notes, and snippets.

@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active November 2, 2024 12:56
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@kennystone
kennystone / gist:805387
Created February 1, 2011 03:47
mongoid datetime resolution less than a second
require 'rubygems'
require "test/unit"
require 'mongoid'
class DT
include Mongoid::Document
field :birthday, :type => DateTime
end
class TestDT < Test::Unit::TestCase
@jph00
jph00 / understanding_fasthtml.md
Last active November 18, 2024 00:18
Understanding FastHTML Components and Architecture - a Claude Conversation

Understanding FastHTML Components and Architecture

🧑 human (Aug 26, 2024, 03:52 PM)

What are the components of FastHTML, and how do they work together? What are some key things I need to understand to write idiomatic FastHTML apps?

🤖 assistant (Aug 26, 2024, 03:52 PM)

Based on the documentation provided, here are the key components of FastHTML and how they work together to create web applications:

  1. Core Components:
@jph00
jph00 / starlette-quick.md
Last active September 1, 2024 03:35
Starlette Quick Manual for FastHTML users

🌟 Starlette Quick Manual

2020-02-09

Starlette is the ASGI web framework used as the foundation of FastHTML. Listed here are some Starlette features FastHTML developers can use directly, since the FastHTML class inherits from the Starlette class (but note that FastHTML has its own customised RouteX and RouterX classes for routing, to handle FT element trees etc).

Get uploaded file content