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 Enemy = require 'nodes/enemy'
local gamestate = require 'vendor/gamestate'
local sound = require 'vendor/TEsound'
local Timer = require 'vendor/timer'
local Projectile = require 'nodes/projectile'
local sound = require 'vendor/TEsound'
local utils = require 'utils'
local window = require 'window'
local camera = require 'camera'
@8bitgentleman
8bitgentleman / Breakable_block with special damage
Created September 28, 2014 02:15
This is a an addition to the breakable block node that accepts special damage. It can be used so the block can not be damaged by anything other than the special damage weapon. This could be used for burning the ground under Cornelius or making a block that only a pickaxe can destroy etc.
local Timer = require 'vendor/timer'
local Level = require 'level'
local anim8 = require 'vendor/anim8'
local sound = require 'vendor/TEsound'
local Dialog = require 'dialog'
local Wall = {}
Wall.__index = Wall
Wall.isWall = true
@8bitgentleman
8bitgentleman / gist:886fd907fa0cb90d3a91
Last active August 29, 2015 14:05
hide/show npc talk items
--this is an example of what talk_items could look like in the npc's file
{ ['text']='flowers', freeze = true, affection = 5 },
--The first for loop looks for the "options” key in the root table of the talk_items. Inside this table we can look for all items in the table that have an affection attribute.
--If the affection attribute is lower than the player affection then we remove the item from the table.
function Menu:itemUpdate( npc, player)
--adds and removes items from the talk items based on affection level
local Player = require 'player'