Skip to content

Instantly share code, notes, and snippets.

@imjared
imjared / notion-toc.js
Last active September 6, 2022 20:11
Notion table of contents bookmarklet
/**
* Note that this only works for pages that have a table of contents. It won't magically make one for you. V2, anyone?
*
* Usage:
* 1. In Chrome, right click your bookmarks menu and click "Add page" in the popup menu
* 2. For "Name", pick something like "Notion TOC Formatter"
* 3. For "URL", paste the code below and click Save
* 4. On a Notion page that has a table of contents, click the bookmarklet and ✨✨
*
* This will only work for the page you're on. As soon as you navigate, ya gotta click again.
@imjared
imjared / Notion table of contents
Created February 4, 2021 16:17
Adds a pinned table of contents when viewing Notion. Relies on uBlock Origin filters
## Add to U
! add notion
notion.so##.notion-table_of_contents-block>div:style(overflow: scroll; overflow-x: hidden; background-color: white; position: fixed !important; top: 4rem; left: 1rem; width: 350px !important; padding: 2rem; border: 1px solid #eee; border-radius: 5px; max-height: calc(100vh - 5rem) !important; overflow: scroll;)
@imjared
imjared / ublock-notion-toc.txt
Created July 7, 2020 15:28
Use uBlock's filters to move Notion's table of contents to somewhere useful
! In ublock's extension settings, under "My Filters", add the following:
! move notion's table of contents to the side
notion.so##.notion-table_of_contents-block>div:style( position: fixed !important; top: 4rem; left: 1rem; width: 350px !important; padding: 2rem; border: 1px solid #eee; border-radius: 5px; max-height: calc(100vh - 5rem) !important; overflow: scroll;)
@imjared
imjared / keybase.md
Last active September 9, 2019 19:50

Keybase proof

I hereby claim:

  • I am imjared on github.
  • I am imjared (https://keybase.io/imjared) on keybase.
  • I have a public key ASAyEZudDaehMsNgynlDs_jxZ6-KcVZF_EubkUKqG4IVCQo

To claim this, I am signing this object:

@imjared
imjared / scraping-with-casperjs.js
Created March 20, 2013 00:33
A CasperJS script that crawled a list of links on then scraped the relevant content on each page and output it to a nicely formatted XML file. Sure beats database dumps/SQL manipulation, in my opinion.
/*jshint strict:false*/
/*global CasperError console phantom require*/
/**
* grab links and push them into xml
*/
var casper = require("casper").create({
});
@imjared
imjared / lime.sh
Created October 16, 2013 16:16
Add to /usr/local/bin. Use `lime [path]` instead of `subl [path]` to open sublime projects. If a project file exists it opens and preserves project settings. Requires `subl`. In response to http://www.sublimetext.com/forum/viewtopic.php?f=3&t=14129
#!/bin/bash
projectFile=$(find $1 -name "*.sublime-project" -maxdepth 1)
echo $projectFile
if [ $projectFile ]
then
subl $projectFile
else
subl $1
fi
@imjared
imjared / lime.sh
Created September 22, 2016 02:02
#!/bin/bash
projectFile=$(find $1 -name "*.sublime-project" -maxdepth 1)
echo $projectFile
if [ $projectFile ]
then
subl $projectFile
else
subl $1
fi
@imjared
imjared / bootstrap-breakpoints.scss
Last active August 16, 2016 10:13
scss breakpoint helpers based on bootstrap
// breakpoint helpers based on bootstrap's breakpoints
@mixin xs {
@media #{screen} and (max-width: #{$screen-xs-max}) {
@content;
}
}
@mixin sm {
@media #{screen} and (min-width: #{$screen-sm-min}) and (max-width: #{$screen-sm-max}) {
@imjared
imjared / rename.sh
Last active December 24, 2015 00:29
if you get a bunch of files that have an undesirable prefix and you want to remove it, just tell this script the prefix
#!/bin/bash
# takes an argument of an undesired prefix then removes it from all files in dir
# if no arg is passed, prompt for name
if [ $# -eq 0 ]
then
read -p 'What prefix do you want to remove?: '
prefix=$REPLY
else
prefix=$1
<textarea style="height: 100%; width: 100%; background: #222; padding: 5% 25%; color: #eee;"></textarea>