Skip to content

Instantly share code, notes, and snippets.

Avatar
🕶️
Dealing With It

David Joseph Guzsik SeinopSys

🕶️
Dealing With It
View GitHub Profile
@SeinopSys
SeinopSys / mix.js
Created Mar 20, 2021
JavaScrip hex color mix function
View mix.js
const mix = (hex1, hex2, percent) => {
const breakup = (hex) => hex.match(/[a-f0-d]{2}/ig).map(n => parseInt(n, 16));
const rgb1 = breakup(hex1);
const rgb2 = breakup(hex2);
const mixed = rgb1.map((c, i) => Math.round((c * (1 - percent)) + (rgb2[i] * percent)).toString(16));
return '#'+mixed.map(s => s.length < 2 ? '0'+s : s).join('');
};
console.log(mix('#000000','#ffffff', .2));
@SeinopSys
SeinopSys / example.puml
Created Aug 29, 2018 — forked from QuantumGhost/example.puml
A simple template for PlantUML to draw ER diagram. The basic idea comes from http://plantuml.sourceforge.net/qa/?qa=331/database-modeling
View example.puml
@startuml
' uncomment the line below if you're using computer with a retina display
' skinparam dpi 300
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >>
' we use bold for primary key
' green color for unique
' and underscore for not_null
!define primary_key(x) <b>x</b>
!define unique(x) <color:green>x</color>
!define not_null(x) <u>x</u>
@SeinopSys
SeinopSys / dvp.user.css
Last active Apr 2, 2017
Derpibooru voting ponies userstyle
View dvp.user.css
@-moz-document url-prefix("https://derpibooru.org"), url-prefix("https://trixiebooru.org") {
.interaction--fave .fa,
.interaction--upvote .fa,
.interaction--downvote .fa,
.interaction--comments .fa {
color: transparent;
background-image: url("https://derpicdn.net/img/view/2017/4/1/1401039.svg");
display: inline-block;
background-size: 64px 64px;
width: 32px;
@SeinopSys
SeinopSys / code.js
Last active Aug 22, 2017
DeviantArt comment timestamp parser + userscript
View code.js
function parseCommentDate(el){
var _months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Nov','Dec'],
_pad = function(n){return n<10?'0'+n:n},
time = el.title.replace(/^.*\(at (\d{1,2}):(\d{1,2}):(\d{1,2}) ([AP]M)\)$/, function(_,h,m,s,ampm){
if (ampm === 'PM'){
h = parseInt(h,10)+12;
if (h >= 24)
h -= 24;
}
else if (ampm === 'AM' && h == 12) h = 0;
@SeinopSys
SeinopSys / pma-update.sh
Last active Sep 27, 2015
Bash script file for updating phpMyAdmin
View pma-update.sh
#!/bin/bash
# <Config>
backuppath="/path/to/backups"
pmapath="/path/to/phpMyAdmin"
# </Config>
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
@SeinopSys
SeinopSys / 133769.user.js
Last active Mar 22, 2019
YouTube userscript: Make "My Subscriptions > Uploads Only" your default page
View 133769.user.js
// ==UserScript==
// @name Make "My Subscriptions > Uploads Only" your default page
// @namespace https://gist.github.com/SeinopSys
// @version 1.2
// @include /^https?\:\/\/(.+\.)?youtube\.com\/.*/
// @author DJDavid98
// @license GPL version 2 or any later version; http://www.gnu.org/licenses/gpl-2.0.txt
// @run-at document-start
// ==/UserScript==
@SeinopSys
SeinopSys / dA Correspondence Cleaner
Last active Aug 29, 2015
deviantArt Correspondence Message Cleaner
View dA Correspondence Cleaner
(function(pageStepDelay,screwComments){
var halfStepDelay = pageStepDelay / 2;
if (!/\.deviantart\.com$/.test(window.location.host) || !/^\/notifications\/?$/.test(window.location.pathname))
return false;
function notify(message,visibleForMS,callback){
console.log(message);
if (visibleForMS !== false) visibleForMS = typeof visibleForMS === 'number' ? visibleForMS : 3000;