Skip to content

Instantly share code, notes, and snippets.

import { Plugin } from "$fresh/server.ts";
const sources = [
"https://raw.githubusercontent.com/bigskysoftware/htmx/dev/src/htmx.js",
"https://raw.githubusercontent.com/bigskysoftware/htmx/dev/src/ext/head-support.js"
]
export default function htmx(): Plugin {
const main = `data:application/javascript,${sources.map(s => `import "${s}";`).join('')} export default () => {}`
return {
@mattdesl
mattdesl / pinning.md
Last active January 28, 2023 19:56
hicetnunc IPFS pinning

Hicetnunc.xyz IPFS Pinning

💡 These steps will become easier, less technical, and more accessible as more open tools begin to emerge around Hicetnunc pinning. The steps below assume macOS but should work similarly across other platforms. This gist can be seen as a working draft toward more polished documentation; if you see any issues please post a comment below.

Basic Idea

Hicetnunc.xyz aims to be "decentralized" which means the OBJKTs are owned by the users, not the platform. So, in theory, if hicetnunc disappears, another marketplace could emerge on the same (user-owned) assets. But, this paradigm of decentralization means that you own the assets; so the responsibility to maintain them lies on the users, not the platform.

Of course, hicetnunc and some of its users will probably also make an effort to help maintain all the assets on its platform; but you should not rely purely on that, as it goes against the core ethos of dec

@Pomax
Pomax / rgbhanalysis.js
Last active November 18, 2024 07:53
Sort a collection of images based on their dominant hue, and show the rgb+h analysis in a nice little image alongside.
(function bookmarklet(window) {
var document = window.document;
var body = document.body;
/**
* Sort a collection of images based on their dominant hue,
* and show the rgb+h analysis in a nice little image alongside.
*
* for instance, use this bookmarklet on
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@filiptepper
filiptepper / rackup-kirk
Created March 8, 2011 11:02
start/stop/restart JRuby application running on Kirk
#! /bin/sh
set -u
NAME=<set your application name here>
DIRECTORY=<set your application directory here>
PIDFILE=/var/run/$NAME.pid
DAEMON="/usr/local/rvm/bin/rvm exec rackup"
DAEMON_ARGS="-s Kirk config.ru -p 3000 -P $PIDFILE"
@rkbodenner
rkbodenner / request_start_variable.patch
Created March 1, 2010 19:08
Add a 'start_time' variable to nginx 0.8.33 to support an X-REQUEST-START header. This header is used by New Relic RPM to record queue time.
--- src/http/ngx_http_variables.c.orig 2010-01-11 03:21:46.000000000 -0800
+++ src/http/ngx_http_variables.c 2010-02-18 10:01:32.000000000 -0800
@@ -93,6 +93,9 @@
static ngx_int_t ngx_http_variable_pid(ngx_http_request_t *r,
ngx_http_variable_value_t *v, uintptr_t data);
+static ngx_int_t ngx_http_variable_start_time(ngx_http_request_t *r,
+ ngx_http_variable_value_t *v, uintptr_t data);
+
/*
@tmm1
tmm1 / a.txt
Created March 4, 2009 02:27
simple heap dumper for ruby 1.8
$ ./miniruby -e 'class T; end; a = 1..1; b = "hi"; c = []; d = Hash.new; e = T.new; p GC.dump_heap'
0x00154750 allocated @ -e:1 is an OBJECT of type: T
0x0015476c allocated @ -e:1 is a HASH which has data
0x00154788 allocated @ -e:1 is an ARRAY of len: 0.
0x001547c0 allocated @ -e:1 is a STRING (ELTS_SHARED) which has len: 2 and val: hi
0x001547dc allocated @ -e:1 is a STRING which has len: 1 and val: T
0x001547f8 allocated @ -e:1 which is a CLASS no name - maybe anon class?
0x00154814 allocated @ -e:1 which is a CLASS named: T inherits from Object
0x00154a98 allocated @ -e:1 is a STRING which has len: 2 and val: hi
0x00154b40 allocated @ -e:1 is an OBJECT of type: Range