Skip to content

Instantly share code, notes, and snippets.

@kaloncpu57
kaloncpu57 / wrap-hex.js
Last active May 5, 2017 03:42
Wrap hex color codes in divs - BetterDiscord plugin piece
class hexColorPreview {
wrapAll() {
let messages = document.getElementsByClassName("markup");
for (var i = 0; i < messages.length; i++) {
let msg = messages[i];
if (msg.getElementsByClassName(".hex-value").length > 0) continue; //don't wrap multiple times
let html = msg.innerHTML;
html = html.replace(
/#(?:[0-9a-fA-F]{3}){1,2}/g, //find hex color values
//This works
window.addEventListener('resize', function(e){
var w = window.innerWidth;
var h = window.innerHeight;
resizeCanvas(w, h);
});
//This does not work
window.addEventListener('resize', function(e){
resizeCanvas(window.innerWidth, window.innerHeight);

Keybase proof

I hereby claim:

  • I am kaloncpu57 on github.
  • I am kaloncpu57 (https://keybase.io/kaloncpu57) on keybase.
  • I have a public key ASBYJg63tOPgOu7gHjSGkOEBjC3uO1ki9veqCFewEQ3q_Qo

To claim this, I am signing this object:

@kaloncpu57
kaloncpu57 / loop.js
Last active November 15, 2015 07:10
// ==UserScript==
// @name YouTube Loop
// @namespace kaloncpu57
// @version 0.8
// @updateURL https://raw.githubusercontent.com/kaloncpu57/youtube-scripts/master/loop.js
// @description Adds a loop option to the YouTube HTML5 player settings
// @author kaloncpu57
// @match http*://www.youtube.com/*
// @grant none
// ==/UserScript==
import requests
import random
import time
from bs4 import BeautifulSoup
from cfg import BOT, PASS, ADMIN
import atexit, sys, os
sys.path.insert(0, os.path.dirname(".."))
import predictor
import lipsum
from chatterbot import ChatterBotFactory, ChatterBotType