Skip to content

Instantly share code, notes, and snippets.

View upman's full-sized avatar

Ravi Kumar L upman

View GitHub Profile
@gkoberger
gkoberger / get-subtitles.js
Created March 5, 2019 21:39
Find the name Greg in Last Week Tonight episodes
var getSubtitles = require('youtube-captions-scraper').getSubtitles;
var _ = require('lodash');
// All Last Week Tonight episodes... and a few related videos that got sucked in by mistake
var videos = ["IdirC1uFdXU","baSNHz4uiX4","-mSGwndFMp8","R7qSiEKntQA","rn6QpV2Vo-0","7VG_s2PCH_c","t0CyBv18A5k","_E9DJS6I2nE","MGpo9DQkSvQ","d5SXQ_zb1XQ","R44dRIPLZGM","s6MwGeOm8iI","abn6cPxrc5w","gvZSpET11ZY","ScmJvmzDcG0","HaBQfSAVt0s","3G7aLVWzJeo","_9BjJkqybz8","4U2eDJnwz_s","IU2ye11FyIQ","WhMGcp9xIhY","CdDBi0DheMw","MdHmp5EX5bE","TB_wx0dAPU0","ximgPmJ9A5s","5HS2TstPfW4","ygVX1z6tDGI","UpdMYOtAmKY","ViDPIyiszoo","FsZ3p9gOkpY","opi8X9hQ7q8","OjPYmEZxACM","NpPyLcQ2vdI","2nXYbGmF3_Q","etkd57lPfPU","Fmh4RdIwswE","ET_b78GSBUs","dHiAls8loz4","dFnN2toxFaY","AJm8PeWkiEU","8-hahRWhFvg","OubM8bD9kck","mOVPStnVgvU","nG2pEffLEJo","hWQiXv0sn9Y","IYfgvS0FA7U","mXQuto1fMp4","5xnZ_CeTqyM","RKjk0ECXjiQ","4NNpkv3Us1I","9fB0GBwJ2QA","rs2RlZQVXBU","g6iDZspbRMg","LEcbagW4O-s","LdhQzXHYLZ4","QCjk_NPsIqU","wrpeEitIEpA","seGgZp-XYdM","1ZAPwfrt
@paambaati
paambaati / launch.js
Last active May 5, 2022 05:35
Debug mocha tests using Visual Studio Code
{
"version": "0.1.0",
// List of configurations. Add new configurations or edit existing ones.
// ONLY "node" and "mono" are supported, change "type" to switch.
"configurations": [
{
// Name of configuration; appears in the launch configuration drop down menu.
"name": "Run app.js",
// Type of configuration. Possible values: "node", "mono".
"type": "node",
@isayev
isayev / gist:f83e507a8ea841bd6cbc
Last active April 17, 2018 19:36
reverse column order in pandas
data[data.columns[::-1]]
@ruckus
ruckus / statistics.sql
Created June 5, 2013 23:26
Postgres statistics queries
** Find commmonly accessed tables and their use of indexes:
SELECT relname,seq_tup_read,idx_tup_fetch,cast(idx_tup_fetch AS numeric) / (idx_tup_fetch + seq_tup_read) AS idx_tup_pct FROM pg_stat_user_tables WHERE (idx_tup_fetch + seq_tup_read)>0 ORDER BY idx_tup_pct;
Returns output like:
relname | seq_tup_read | idx_tup_fetch | idx_tup_pct
----------------------+--------------+---------------+------------------------
schema_migrations | 817 | 0 | 0.00000000000000000000
user_device_photos | 349 | 0 | 0.00000000000000000000
@yuya-takeyama
yuya-takeyama / binarytree.rb
Created February 5, 2011 14:32
Binary Tree implemented in Ruby.
module BinaryTree
class Node
attr_reader :word, :count, :left, :right
include Enumerable
def initialize(word)
@word, @count = word, 1
end
@dnagir
dnagir / rspec-syntax-cheat-sheet.rb
Created November 5, 2010 09:29
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")