Skip to content

Instantly share code, notes, and snippets.

@CS1000
CS1000 / colornames.js
Last active August 29, 2015 14:08 — forked from rlemon/colornames.js
For use on Miaou (add "color: <#hexcolor || colorname>" somewhere in your profile->about me)
function hashCode(str) {
var hash = 0;
str += '!';
for (var i = 0; i < str.length; i++) {
hash = str.charCodeAt(i) + ((hash << 5) - hash);
}
return -hash;
}
function colorCode(i) {
return '#' + (Math.min((i >> 24) & 0xFF, 200).toString(16) +
@CS1000
CS1000 / hide_answers.js
Created April 2, 2015 10:29
SNIPPET to hide all answers on a StackExchange post, except the one linked to (hash anchor, eg. #id) if exists.
javascript:(function(){$(".answer").each(function(i,n){if(n.id!==('answer'+document.location.hash).replace(/#/,'-'))n.style.display="none"})})()
@CS1000
CS1000 / syntax-highlight_regex.MD
Last active August 29, 2015 14:18
google-code-prettify renderings of REGEX with supported Languages

sh

/^(d*([.,](?=d{3}))?d+)+((?!\2)(?R)(?1)\K\R\n\r[a-z\d])[.,]dd)?$/

c

@CS1000
CS1000 / JamExchange.js
Last active July 17, 2017 12:50
JamExchange Room @so Live Radio like Player with "User Requests" (YouTube only, UserScript)
// ==UserScript==
// @name JamExchange Player
// @namespace jamexchange
// @description JamExchange Room @SO Live Radio like Player with "User Requests" (YoutTube only)
// @include http://chat.stackoverflow.com/rooms/39426/*
// @version 1.1.0
// @grant none
// ==/UserScript==
/*