Skip to content

Instantly share code, notes, and snippets.

View beeksiwaais's full-sized avatar

Beeksi beeksiwaais

View GitHub Profile
@beeksiwaais
beeksiwaais / yt-subscription-toggle-bookmark.js
Created May 25, 2023 00:42
This JavaScript bookmarklet is designed to manipulate the visibility of videos on a YouTube Subscription page. It alternates between three states - 'initial', 'hide-shorts', and 'hide-others'. In the 'initial' state, all videos are visible. In the 'hide-shorts' state, YouTube 'Shorts' videos are hidden, while other videos remain visible. In the …
javascript:(function() {
const hide = e => e.style.display = 'none';
const show = e => e.style.display = 'inline-block';
const states = ['initial', 'hide-shorts', 'hide-others'];
const isHidden = e => e.style.display === 'none';
const allElements = Array.from(document.querySelectorAll("ytd-grid-video-renderer"));
const shorts = allElements.filter(e => e.querySelector("span[aria-label='Shorts']"));
const others = allElements.filter(e => !e.querySelector("span[aria-label='Shorts']"));

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@beeksiwaais
beeksiwaais / mysql2_column_cache.rb
Created April 23, 2012 14:07 — forked from raggi/mysql2_column_cache.rb
Mysql2 Column Cache for Rails 3.0.12
# = MONKEY PATCH: Memoize Mysql2 Columns
#
# Reduces SHOW FIELDS selects in production to essentially 0 calls.
#
# == Reason:
#
# * We have some pages that are (with rails 3.0.12) generating nearly 1200 SHOW
# FIELDS sql statements.
# * These come from ActiveRecord::Associations during complex join semantics.
# * Esentially, through some relations, Arel::Table instances don't have
@beeksiwaais
beeksiwaais / dock-space-display.txt
Created December 22, 2010 23:54
Ajouter des espaces à son Dock sur Mac OS
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'
killall Dock