Skip to content

Instantly share code, notes, and snippets.

Karthik T ktaragorn

Block or report user

Report or block ktaragorn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ktaragorn / cdc_add_to_google_calendar.user.js
Created Apr 4, 2018
Add CDC (ComfortDelgro Driving Centre) class bookings to google calendar
View cdc_add_to_google_calendar.user.js
// ==UserScript==
// @name Add CDC (ComfortDelgro Driving Centre) class bookings to google calendar
// @namespace ktaragorn
// @description Adds a link to export the class booking to google calendar so that you dont make mistakes in manual entry of date/time and miss the class
// @include*
// @version 2
// @grant none
// ==/UserScript==
function make_date(time_array){
ktaragorn / youtube_watchlater.user.js
Last active Aug 30, 2017
Copy Video Links from Youtube Watch Later
View youtube_watchlater.user.js
// ==UserScript==
// @name Copy Video Links from Youtube Watch Later
// @namespace ktaragorn
// @description Copy Video Links from Youtube Watch Later for later downloading
// @include
// @version 2
// @grant none
// ==/UserScript==
function getUrls(){
ktaragorn / yourturnmyturn_notification.user.js
Last active Jul 5, 2017
Desktop Notifications for YourTurnMyTurn
View yourturnmyturn_notification.user.js
// ==UserScript==
// @name Desktop Notifications for YourTurnMyTurn
// @namespace ktaragorn
// @include
// @description Desktop Notifications for overview page when it is your turn
// @version 6
// @grant none
// ==/UserScript==
function refresh()
ktaragorn / gist:a0ff7153a8eab6521fa49ac8276c9083
Last active Aug 30, 2017
Get all video urls in your youtube playlist (watch later list in this case). Run this in browser inspect on that page.
View gist:a0ff7153a8eab6521fa49ac8276c9083
JSON.stringify(".pl-video-title-link")).map(function(a){return a.href.replace(/&list=.*/g,'').replace(/&index=.*/g,'')}))
ktaragorn / release_issues.rb
Last active Mar 21, 2017
Which issues have commits in the specified release branch
View release_issues.rb
#!/usr/bin/env ruby
unless ARGV.first
fail("Provide the name of the release branch. For e.g for release/5.0 provide 5.0 as the branch name")
base = ARGV[1] || "master"
puts "Ensure that this is run in the repository you want the data from!"
`git fetch`
pr_regexp = "Merge pull request"
ktaragorn / gist:3a138330a29592ab9582dca30dddd604
Created Dec 16, 2016
Simple CLI to run scan or clean on kodi video library
View gist:3a138330a29592ab9582dca30dddd604
if [ "$1" == "clean" ]
elif [ "$1" == "scan" ]
View gist:764aa15a4c0e185ac28ac2690749b660
var data = $("tbody tr").map(function(){
var $row = $(this)
var category = $row.find(".record-category").text()
var date = $row.find("td:last-child .ng-binding").text().split(" ").join("").split("\n").join("")
var amount = $row.find(".nonreferential-amount span:last-child").text()
var currency = $row.find(".nonreferential-amount .currency-code").text()
var amount_sgd = $row.find(".negative-amount .record-amount").text()
var payment_type = $row.find("img.payment-icon").attr("title")
var description = $row.find(".record-note").text()
return [[category, description, amount, currency, amount_sgd, payment_type, date]]
View ssh_config
Host shortname1?
Host test-myname
Host *
Hostname %h
Match Host *
ktaragorn / table.rb
Last active Jan 17, 2017
Simple script that lets you add table view to any irb - just copy paste and use with `table <list of arrays or hashable objects>`. `htable` works the same as `table`, but generates a horizontal table.
View table.rb
def get_columns list, options = {}
all ={|item| item.columns}.flatten.uniq
symize = ->(key){key.try(:to_sym) || key}
if options[:only]
Array(options[:only]).map(&symize) & all
elsif options[:keys_search]{|k| k.to_s.downcase.match(options[:keys_search].to_s.downcase)}
all - Array(options[:not]).map(&symize)
ktaragorn / progress_bar.rb
Last active Mar 31, 2016
A simple progress bar class
View progress_bar.rb
class ProgressBar
def initialize max
@max = max
@current = 0.0
def draw
progress = @current/@max
wipe = "\r"
bar_length = 20
You can’t perform that action at this time.