Skip to content

Instantly share code, notes, and snippets.

View thegreatshasha's full-sized avatar

Shashwat Kumar thegreatshasha

  • UVA
  • Charlottesville, Virginia
View GitHub Profile
@thegreatshasha
thegreatshasha / Logfile
Last active August 29, 2015 13:56
Typhoeus high memory usage test
sourcefile sourceline class memsize count
------------------------------------------------------ ---------- ---------------------------------- ------- -----
<GEM:ethon-0.6.1>/lib/ethon/multi/operations.rb 144 FFI::Pointer 0 12426
<GEM:ethon-0.6.1>/lib/ethon/multi/operations.rb 171 FFI::Pointer 0 7500
<GEM:ethon-0.6.1>/lib/ethon/curls/options.rb 10 String 0 6200
<GEM:ethon-0.6.1>/lib/ethon/curls/options.rb 79 String 0 6200
<GEM:ethon-0.6.1>/lib/ethon/curls/options.rb 11 String 0 6200
<GEM:ethon-0.6.1>/lib/ethon/curls/options.rb 10 String 25 3100
<GEM:ethon-0.6.1>/lib/ethon/curls/options.rb 11 Stri
module.exports = function(){
// The theoretical bound on number of integers necessary to generate n primes
this.upperBound = function(num) {
return parseInt(num*(Math.log(num)+Math.log(Math.log(num))));
}
this.composites = {}
this.currentPrime = 1
Traceback (most recent call last):
File "/home/shashwat/envs/rebelmouse/local/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/mnt/local/home/shashwat/rebelmouse/community/tests/views/garyvee/test_pages.py", line 13, in test_pages
fp.test_success_response()
[{"status": 2, "created_ts": 1418377124000, "isPublic": true, "page_settings": {"open_in_new_tab": false}, "tags": ["#wishes", "#macys", "#kids"], "url": "wishes", "site_id": 11, "about_html": "", "isUnlisted": false, "order": 0, "isStage": false, "isPrivate": false, "title": "wishes", "url_header_image": "", "type": 0, "id": 25}]
Router.route('/meetings/add', {
name: 'addMeetingRoute',
template: 'addMeeting',
waitOn: function(){
return [Meteor.subscribe('hearings'), Meteor.subscribe('events'), Meteor.subscribe('projects'), Meteor.subscribe('tasks'), Meteor.subscribe('meetings'), Meteor.subscribe('lawyers')];
}
});
var cache = {}
var counter = 0
// Function to calculate levenshtein distance
function minDist(string1, string2) {
if(cache[string1] && cache[string1][string2])
return cache[string1][string2]
if(!string1.length)
return cache_score(string1, string2, string2.length)
@thegreatshasha
thegreatshasha / numpy_ring_buffer.py
Created November 5, 2015 23:30
Fixed size circular buffer in python. Contains tests to compare it with the inbuilt deque.
from numpy import ndarray
import numpy as np
from collections import deque
import timeit
class RingBuffer():
def __init__(self, shape, dtype=np.int):
self.shape = shape
self.size = self.shape[0]
@thegreatshasha
thegreatshasha / wrapper.py
Created December 9, 2015 18:46
Plotly wrapper
import plotly.plotly as p
import datetime
import time
import numpy as np
import json
from plotly.graph_objs import *
import timeit
class Plotter:
import plotly.plotly as p
import datetime
import time
import numpy as np
import json
from plotly.graph_objs import *
import timeit
class Plotter:
from visualize import Plotter
import time
plotly = Plotter({'streaming_token': 'YOUR_STREAMING_TOKEN'})
for i in range(10):
time.sleep(5)
plotly.write(i, i)