Skip to content

Instantly share code, notes, and snippets.

View karuppasamy's full-sized avatar
🎯
Focusing

Karuppasamy M karuppasamy

🎯
Focusing
  • Cognizant
  • Belfast, NI
View GitHub Profile
@karuppasamy
karuppasamy / Remove videos from Youtube Watch Later playlist.md
Created March 17, 2023 20:22 — forked from astamicu/Remove videos from Youtube Watch Later playlist.md
Script to remove all videos from Youtube Watch Later playlist

UPDATED 22.11.2022

It's been two years since the last update, so here's the updated working script as per the comments below.

Thanks to BryanHaley for this.

setInterval(function () {
    video = document.getElementsByTagName('ytd-playlist-video-renderer')[0];

 video.querySelector('#primary button[aria-label="Action menu"]').click();
@karuppasamy
karuppasamy / computer science books
Created December 30, 2020 12:54
computer science books
https://csgordon.github.io/books.html
@karuppasamy
karuppasamy / cloudSettings
Last active October 6, 2019 17:21
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-10-06T17:21:27.113Z","extensionVersion":"v3.1.2"}
@karuppasamy
karuppasamy / country_flag_by_country_code
Created September 4, 2019 08:09
Country flag by country code
// ruby
(->code { code.codepoints.map { |cp| cp + 127397 }.pack('U*') }).('GB') => "🇬🇧"
// javascript
(code => String.fromCodePoint(...[...code].map(c => 127397 + c.charCodeAt())))('GB') => "🇬🇧"
@karuppasamy
karuppasamy / module_private_public.rb
Created November 12, 2018 09:41
Ruby Module - Private, Public method
module Bar
def self.included(base)
class << base
def public_method # public method
puts "public method"
end
def call_private # public method
puts "Call Private from Public"
private_method
@karuppasamy
karuppasamy / git-delete-remote-branch
Created July 25, 2016 04:20
Git - Delete remote branches
# Delete remote branches except `master` and `development`
git branch -r --merged | grep origin | grep -v '>' | grep -v master | grep -v development | grep -v sprint | xargs -L1 | cut -d"/" -f2- | xargs git push origin --delete > ~/Documents/remote_branch
@karuppasamy
karuppasamy / git-info
Created July 25, 2016 04:18
Git Info
#!/bin/bash
set -e
# actually parse the options and do stuff
while [[ $1 = -?* ]]; do
case $1 in
--gc)
echo "Repacking objects"
git gc --aggressive --auto
@karuppasamy
karuppasamy / git-activity
Created July 25, 2016 04:17
Git activity.
#!/bin/bash
set -e
GIT_OPTS=""
OUTPUT_FILTER="cat" # no-op
commit_id_format=$(tput setaf 1)
date_format=$(tput bold; tput setaf 4)
author_format=$(tput setaf 2)
@karuppasamy
karuppasamy / pre-push
Created July 25, 2016 04:17
Git Pre-push - Notify on Pivotal Tracker
#!/usr/bin/env ruby
# encoding: UTF-8
# Atlassian Stash and Pivotal Tracker Integration
# ===============================================
# - Post commit message details on Pivotal Tracker's user story
# Usage
# =====
# Create a branch with hash(#) + user story id. (#123467)
@karuppasamy
karuppasamy / pre-commit
Created July 25, 2016 04:15
Git pre-commit hook
#!/usr/bin/env sh
# This hook has a focus on portability.
# This hook will attempt to setup your environment before running checks.
#
# If you would like `pre-commit` to get out of your way and you are comfortable
# setting up your own environment, you can install the manual hook using:
#
# pre-commit install --manual
#