Skip to content

Instantly share code, notes, and snippets.

@8bitgentleman
8bitgentleman / roam-backend-api-example.py
Last active September 27, 2023 17:28
Example python functions for accessing the Roam Research Alpha Backend API
import requests
import json
import pprint
GRAPH_NAME = "GRAPH"
API_TOKEN_READ = "TOKEN"
API_TOKEN_WRITE = 'TOKEN'
BASE_URL = "https://api.roamresearch.com"
ENDPOINT_q = f"/api/graph/{GRAPH_NAME}/q"
@8bitgentleman
8bitgentleman / shades-of-purple.css
Created July 29, 2022 02:02
Shades of Purple redone for the CSS Toggle Extension - original here https://abhayprasanna.github.io/shades-of-purple.css
@import url('https://abhayprasanna.github.io/better-dark-age.css');
@import url('https://fonts.googleapis.com/css?family=Lato|Crimson+Text|Noto+Sans+Mono|Alegreya|Work+Sans');
:root {
/* FONTS */
--global-font : 'Work Sans', sans-serif;
--secondary-font : 'Noto Sans Mono', monospace;
--header-font : 'Bitter', serif;
/* WIDTH FIXES - default 568px,1032px - increase to increase WIDTH */
--reduce-padding-right : 3400px;
@8bitgentleman
8bitgentleman / Roam_Hypothesis_hiccup.py
Created June 28, 2020 21:54
Uses Alfred to create a custom styled hiccup in Roam Research that matches Hypothes.is
# -*- coding: utf-8 -*-
import json
import urllib2
import datetime
import sys
import subprocess
from tkinter import Tk
import os
{ "icons": {
"clear-day":"http://i.imgur.com/O4nYKij.png",
"clear-night":"http://i.imgur.com/v0MBXnQ.png",
"cloudy":"http://i.imgur.com/Ss87T64.png",
"fog":"http://i.imgur.com/QI9Hzq3.png",
"partly-cloudy-day":"http://i.imgur.com/AEH0Hp5.png",
"partly-cloudy-night":"http://i.imgur.com/bzZs24W.png",
"rain":"http://i.imgur.com/nyi3wvO.png",
"sleet":"http://i.imgur.com/xdhkOfk.png",
"snow":"http://i.imgur.com/LSmINQp.png",
{ "icons": {
"clear-day":"http://i.imgur.com/O4nYKij.png",
"clear-night":"http://i.imgur.com/v0MBXnQ.png",
"cloudy":"http://i.imgur.com/Ss87T64.png",
"fog":"http://i.imgur.com/QI9Hzq3.png",
"partly-cloudy-day":"http://i.imgur.com/AEH0Hp5.png",
"partly-cloudy-night":"http://i.imgur.com/bzZs24W.png",
"rain":"http://i.imgur.com/nyi3wvO.png",
"sleet":"http://i.imgur.com/xdhkOfk.png",
"snow":"http://i.imgur.com/LSmINQp.png",
@8bitgentleman
8bitgentleman / 0_reuse_code.js
Created June 30, 2017 13:25
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
import scriptcontext
import rhinoscriptsyntax as rs
import clr
clr.AddReference("Eto")
clr.AddReference("Rhino.UI")
from Rhino.UI import *
from Eto.Forms import Form, Dialog, Label, TextBox, StackLayout, Orientation, Button, HorizontalAlignment, MessageBox, DropDown, CheckBox, TableLayout, StackLayoutItem, DynamicLayout, Control, Panel, Form
from Eto.Drawing import *
local Timer = require 'vendor/timer'
local sound = require 'vendor/TEsound'
return{
name = 'jellyfish-blueberry',
die_sound = 'acorn_crush',
position_offset = { x = 0, y = 0 },
height = 48,
width = 48,
bb_width = 48,
-- The MovingPlatform node facilitates platforms that move back and fourth along a Bspline Curve
-- So setup a movingplatform, you will need to create 2 objects:
-- The 'control' object represents the size of the ledge and contains all of the properties required to make it work
-- The 'line' object is a polyline that represents the path that the platform will follow
-- 'control' object:
-- Must be setup in the 'nodes' object layer
-- Required:
-- 'line' ( string ) - the name of the polyline that defines the path
local Gamestate = require 'vendor/gamestate'
local Prompt = require 'prompt'
local Timer = require 'vendor/timer'
local hiddendoortrigger = {}
hiddendoortrigger.__index = hiddendoortrigger
-- Nodes with 'isInteractive' are nodes which the player can interact with, but not pick up in any way
hiddendoortrigger.isInteractive = true
function hiddendoortrigger.new(node, collider)