Skip to content

Instantly share code, notes, and snippets.

@curtosis
curtosis / notion.js
Created January 2, 2023 19:07 — forked from soldni/notion.js
A Scriptable widget to display ToDos from a Notion database in a iOS widget.
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: light-gray; icon-glyph: copy;
// follow instructions here https://developers.notion.com/docs/create-a-notion-integration
// for how to configure an integration, get the bearer token, and authorize the integration
// to access a Notion database.
const NOTION_DB_LINK = "https://www.notion.so/[YOUR USERNAME]/[LINK TO DATABASE]"
const BEARER_TOKEN = "Bearer secret_*******************************************"
@curtosis
curtosis / SMBDIS.ASM
Last active January 1, 2023 02:23 — forked from 1wErt3r/SMBDIS.ASM
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
(defn row [label input]
[:div.row
[:div.col-md-2 [:label label]]
[:div.col-md-5 input]])
(defn make-user-form-template [ratom]
(let [user-count (:user-count @ratom)]
[:div
[:button {:on-click #(swap! ratom update-in [:user-count] inc)} "Add User"]
[:div
;; setup db to test with
;; note that this setup uses a local dev transactor
;; you can use a different transactor, but you cannot
;; use a mem db because it does not support the log API
(require '[datomic.api :as d])
(def uri "datomic:dev://localhost:4334/reified-txes")
(d/delete-database uri)
(d/create-database uri)
(def conn (d/connect uri))
@curtosis
curtosis / rest.scala
Created July 22, 2012 14:10 — forked from stonegao/rest.scala
Basic RESTful service with Finagle
class Respond extends Service[Request, Response] with Logger {
def apply(request: Request) = {
try {
request.method -> Path(request.path) match {
case GET -> Root / "todos" => Future.value {
val data = Todos.allAsJson
debug("data: %s" format data)
Responses.json(data, acceptsGzip(request))
}
case GET -> Root / "todos" / id => Future.value {
@curtosis
curtosis / setup-statsd.sh
Created July 9, 2012 14:43 — forked from eloe/setup-statsd.sh
Turn an Ubuntu 12.04 Amazon EC2 Micro instance into a StatsD/Bucky/Graphite server
# install git
sudo apt-get install g++ curl libssl-dev apache2-utils make
sudo apt-get install git-core
# download the Node source, compile and install it
cd /opt
git clone https://github.com/joyent/node.git
cd node
git checkout v0.6.18
./configure