Skip to content

Instantly share code, notes, and snippets.

View dineshprabu-freshdesk's full-sized avatar

Dineshprabu S dineshprabu-freshdesk

View GitHub Profile
0001 0000 000d 0080 0003 0050 4646 544d
677b a7e4 0001 f8d4 0000 001c 4744 4546
03b6 0006 0001 f8b4 0000 0020 4f53 2f32
2fbe dc40 0000 0158 0000 0056 636d 6170
e71d f3d3 0000 0fd4 0000 0152 6761 7370
ffff 0003 0001 f8ac 0000 0008 676c 7966
ef6a f641 0000 183c 0001 bb84 6865 6164
fccd 45ef 0000 00dc 0000 0036 6868 6561
04a1 03e6 0000 0114 0000 0024 686d 7478
11cb 2e4b 0000 01b0 0000 0e24 6c6f 6361
@dineshprabu-freshdesk
dineshprabu-freshdesk / thread-pool.rb
Created April 8, 2018 03:39 — forked from rosenfeld/thread-pool.rb
Simple thread pool implementation in Ruby
require 'thread' # for Mutex: Ruby doesn't provide out of the box thread-safe arrays
class ThreadPool
def initialize(max_threads = 10)
@pool = SizedQueue.new(max_threads)
max_threads.times{ @pool << 1 }
@mutex = Mutex.new
@running_threads = []
end
@dineshprabu-freshdesk
dineshprabu-freshdesk / super-tip.txt
Created May 10, 2018 11:52 — forked from ericdouglas/super-tip.txt
Change 4 spaces to 2 spaces indentation and change tab to spaces - Vim tip
// 4 spaces to 2 spaces
%s;^\(\s\+\);\=repeat(' ', len(submatch(0))/2);g
// Tab to 2 spaces
:%s/\t/ /g