Skip to content

Instantly share code, notes, and snippets.

View pfgithub's full-sized avatar
💭
Typing a status

pfg pfgithub

💭
Typing a status
View GitHub Profile
@pfgithub
pfgithub / commentbars.user.css
Last active June 23, 2018 01:01
Comment Bars
@-moz-document domain("tildes.net") {
.btn.btn-comment-collapse {
position: absolute;
transform: translate(-20px, -4px);
background-color: #eee;
border: none;
height: 100%;
transition: 0.1s background-color, 0.1s transform;
display: inline-flex;
text-align: right;
@pfgithub
pfgithub / get_belled_channels.js
Created December 16, 2017 23:08
Get all belled channels on youtube
// Visit https://www.youtube.com/subscription_manager
let vals = [];
Array.from(document.getElementsByClassName("yt-uix-subscription-notifications-all")).forEach((bellicon) => {
vals.push(bellicon.parentNode.parentNode.parentNode.childNodes[0].childNodes[0].childNodes[0].getAttribute("href").replace("/channel/", "")/*replace first instance*/);
});
vals
@pfgithub
pfgithub / solutions.js
Last active December 5, 2017 05:25
Advent of Code Solutions 2017
// 1
function getcaptcha(digits){
let count = 0;
digits.split("").forEach((digit, i,ds) => {
let nextDigit = ds[i+1] || ds[0];
if(digit == nextDigit) count += parseInt(digit, 10);
});
return count;
}
@pfgithub
pfgithub / app.js
Last active November 15, 2015 02:04
const wm = require('./api/windowman.js');
console.log(wm);
var window = new wm.Window("My window");