Skip to content

Instantly share code, notes, and snippets.

View sap1ens's full-sized avatar

Yaroslav Tkachenko sap1ens

View GitHub Profile
@sap1ens
sap1ens / mergesort.py
Last active March 31, 2017 04:40 — forked from mailpraveens/mergesort
sort in python
#The merge method takes in the two subarrays and creates a output array
def merge(left, right):
result = []
i , j = 0 , 0
while i < len (left) and j < len (right): # iterate through both arrays and arrange the elements in sorted order
if left[i] <= right [j]:
result.append(left[i])
i+=1
else:
result.append(right[j])
@sap1ens
sap1ens / jquery.ba-tinypubsub.js
Created April 25, 2012 04:56 — forked from cowboy/HEY-YOU.md
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);