Skip to content

Instantly share code, notes, and snippets.

@ramkumar-kr
ramkumar-kr / minheap.rb
Created December 19, 2019 05:47
Very simple heap implementation in ruby
class MinHeap
attr_reader :heap
def initialize()
@heap = []
end
def insert(element)
@heap.push(element)
heapify_up(@heap.size - 1)
@ramkumar-kr
ramkumar-kr / backburner_test_helper.rb
Created September 28, 2017 07:29 — forked from nesquena/backburner_test_helper.rb
Backburner Test Helper
if Rails.env.test?
module Backburner
def self.test_mode
@test_mode ||= :fake
end
def self.test_mode=(mode)
@test_mode = mode
end
@ramkumar-kr
ramkumar-kr / flickrdownload.html
Last active June 3, 2017 12:13 — forked from steren/flickrdownload.html
Download all pictures from a flickr set. This script will list links to pictures files. You can then bulk-download them using a browser extension (Download master for Chrome, DownThemAll for Firefox...)
<!DOCTYPE html>
<html>
<head>
<script src="http://documentcloud.github.com/underscore/underscore-min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>