Skip to content

Instantly share code, notes, and snippets.

View eritbh's full-sized avatar

Erin eritbh

View GitHub Profile
@eritbh
eritbh / index.md
Last active March 12, 2018 00:42
A bookmarklet to add Markdown support to /r/toolbox's personal notes.

Personal Notes Markdown Mode

A bookmarklet script that adds a custom CodeMirror-based Markdown view to the Personal Notes editor of toolbox. A product of boredom and a personal lesson in bookmarklets, dynamic script loading, and (on a note unrelated to the final product) the limitations of Chromebooks.

Features

  • Custom font sizes for headings 1 through 3, and bold/underline/italic for headings 4-6
  • When a list item wraps to a second line, include a hanging indent to align the wrapped portion of the line with the start of the text (unordered lists only at the moment)
  • Status bar with cursor position indicator and very simple settings pane, including an option to enable and disable line numbers
  • Roughly compatible with the Reddit redesign
/*==============================================
Prelougue
-----------------------------------------------*/
/*Colors*/
/*Main Blue: #000080 (Navy Blue) 0, 0, 128*/
/*Secondary Black: #000000 0, 0, 0*/
/*Third White: #FFFFFF*/
/*Fourth: #C0C0C0 192,192,192*/
" Vim color file
" Converted from Textmate theme Ariake using Coloration v0.4.0 (http://github.com/sickill/coloration)
set background=dark
highlight clear
if exists("syntax_on")
syntax reset
endif
#header{height:165px;background:#2d4059;border-bottom:none}#header #header-bottom-right #mail.havemail,#header #modmail.havemail,.comments-page.linkflair-bug .flat-list a.flairselectbtn:after,.comments-page.linkflair-help .flat-list a.flairselectbtn:after{animation:1s ease-out 0s normal none infinite running pulsate;animation-duration:2s;animation-timing-function:ease-out;animation-delay:0s;animation-direction:normal;animation-fill-mode:none;animation-iteration-count:infinite;animation-play-state:running;animation-name:pulsate}#header-bottom-left{height:140px}#header-bottom-left .tabmenu{background:rgba(0,0,0,.2);width:calc(100% - 50px);padding-left:50px;position:absolute;bottom:0;left:0;font-family:"Segoe UI",Helvetica,sans-serif;transition:.5s}#header-bottom-left .tabmenu li{font-weight:400;margin:0}#header-bottom-left .tabmenu li a{background:0;color:#ddd;border-bottom:2px solid transparent;font-size:11.4px;font-family:"Segoe UI",Helvetica,sans-serif;line-height:30px;padding:8px 9px 6px;letter-spacing:.1em
#header{height:165px;background:#2d4059;border-bottom:none}#header #header-bottom-right #mail.havemail,#header #modmail.havemail,.comments-page.linkflair-bug .flat-list a.flairselectbtn:after,.comments-page.linkflair-help .flat-list a.flairselectbtn:after{animation:1s ease-out 0s normal none infinite running pulsate;animation-duration:2s;animation-timing-function:ease-out;animation-delay:0s;animation-direction:normal;animation-fill-mode:none;animation-iteration-count:infinite;animation-play-state:running;animation-name:pulsate}#header-bottom-left{height:140px}#header-bottom-left .tabmenu{background:rgba(0,0,0,.2);width:calc(100% - 50px);padding-left:50px;position:absolute;bottom:0;left:0;font-family:"Segoe UI",Helvetica,sans-serif;transition:.5s}#header-bottom-left .tabmenu li{font-weight:400;margin:0}#header-bottom-left .tabmenu li a{background:0;color:#ddd;border-bottom:2px solid transparent;font-size:11.4px;font-family:"Segoe UI",Helvetica,sans-serif;line-height:30px;padding:8px 9px 6px;letter-spacing:.1em
@eritbh
eritbh / maybe.py
Last active October 9, 2017 04:35
import praw, time, requests, json
r = praw.Reddit(
client_id="",
client_secret="",
username="",
password="",
user_agent="script:some_random_identifier:v1.0 (by /u/you)")
sub = r.subreddit("your_sub") # no /r/ here
@eritbh
eritbh / fml.js
Last active January 8, 2018 22:59
;(function batchDeleteMyMessages (channel, limit, before = undefined, loops = 1) {
if (limit <= 0 || loops > 10) return console.log(limit, loops) // If there are no more messages or we've been here too long, leave
// Get 100 messages from the channel
channel.getMessages(100, before).then(messages => {
// Get a list of all the messages from the bot
let toDelete = messages.filter(m => m.author.id === (channel.guild.shard.client || channel._client).user.id)
// Also save the ID of the first message so we can give to the next iteration
const firstMessageId = messages[0].id
@charset "utf-8";
/* CSS Document */
@import url(http://fonts.googleapis.com/css?family=Oswald:700);
body {
background-attachment: fixed, scroll;
background-color: #FFF;
background-image: url("https://i.imgur.com/rrZbXQb.jpg"), url("http://i.imgur.com/CY8doiE.png");
@eritbh
eritbh / dmHelp.js
Last active January 29, 2018 00:55
// replaces https://github.com/abalabahaha/eris/blob/master/lib/command/CommandClient.js#L78-L123
this.registerCommand("help", (msg, args) => {
var result = "";
if(args.length > 0) {
var cur = this.commands[this.commandAliases[args[0]] || args[0]];
if(!cur) {
return "Command not found";
}
var label = cur.label;
for(var i = 1; i < args.length; ++i) {
@eritbh
eritbh / asdf.js
Last active January 29, 2018 01:00
bot.registerCommand("help", (msg, args) => {
var result = "";
if(args.length > 0) {
var cur = bot.commands[bot.commandAliases[args[0]] || args[0]];
if(!cur) {
return "Command not found";
}
var label = cur.label;
for(var i = 1; i < args.length; ++i) {
cur = cur.subcommands[cur.subcommandAliases[args[i]] || args[i]];