Skip to content

Instantly share code, notes, and snippets.

// See link and replace following settings
const title = 'Lucky idea';
const icon = 'bp3-icon bp3-icon-clean icon';
@oschmid
oschmid / roam-random-page.js
Last active June 6, 2021 21:20
Adds a 'Random' button to the left sidebar. Works anywhere in Roam. Shift-Click to open in right sidebar (you may see 'All Pages' appear briefly). Alt+R or Alt+Shift+R keyboard commands. Moved to https://github.com/oschmid/roam-plugins/blob/master/random-page-plugin.js
// Moved to https://github.com/oschmid/roam-plugins/blob/master/random-page-plugin.js
@oschmid
oschmid / roam-random-page.js
Created August 13, 2020 03:53
Adds a 'Random' button to the left sidebar.
var randomButton = document.querySelector('#random-button');
if (randomButton != null) {
randomButton.parentNode.removeChild(randomButton);
}
function getEventHandlers(element) {
for (var prop in leftMenu) {
if (prop.includes('reactEventHandlers')) {
return element[prop];
}
}
@oschmid
oschmid / roam-left-sidebar-expander.js
Last active March 8, 2021 20:53
Makes the left sidebar expand on mouse over. THIS CODE IS OUT OF DATE! For latest go to https://github.com/oschmid/roam-plugins
var leftExpander = document.querySelector('#left-expander');
if (leftExpander != null) {
leftExpander.parentNode.removeChild(leftExpander);
}
function getEventHandlers(element) {
for (var prop in element) {
if (prop.includes('reactEventHandlers')) {
return element[prop];
}
}
@oschmid
oschmid / ToDoList.java
Last active March 12, 2020 19:55
To Do List Design Exercise
public class Task {
public Status status;
public String description;
public Optional<Integer> priority;
public Visibility visibility;
}
public enum Status {
TODO, IN_PROGRESS, UNDER_REVIEW, BLOCKED, DONE
}