Skip to content

Instantly share code, notes, and snippets.

@endolith
endolith / peakdet.m
Last active February 14, 2024 21:27
Peak detection in Python [Eli Billauer]
function [maxtab, mintab]=peakdet(v, delta, x)
%PEAKDET Detect peaks in a vector
% [MAXTAB, MINTAB] = PEAKDET(V, DELTA) finds the local
% maxima and minima ("peaks") in the vector V.
% MAXTAB and MINTAB consists of two columns. Column 1
% contains indices in V, and column 2 the found values.
%
% With [MAXTAB, MINTAB] = PEAKDET(V, DELTA, X) the indices
% in MAXTAB and MINTAB are replaced with the corresponding
% X-values.
diff --git a/nvm.sh b/nvm.sh
index 7aaac55..5536c6e 100644
--- a/nvm.sh
+++ b/nvm.sh
@@ -38,7 +38,7 @@ nvm()
cd "$NVM_DIR/src" && \
git clone git://github.com/ry/node.git && \
cd node && \
- ./configure --prefix="$NVM_DIR/HEAD" && \
+ ./configure --debug --prefix="$NVM_DIR/HEAD" && \
@trevmex
trevmex / bst.js
Created February 11, 2011 05:38
A simple binary search tree in JavaScript
/*
* File: bst.js
*
* A pure JavaScript implementation of a binary search tree.
*
*/
/*
* Class: BST
*
anonymous
anonymous / req.cpp
Created June 17, 2011 17:34
Require implementation
//Include a script file into current context
//Raise javascript exception if load failed
v8::Handle<v8::Value> _BeaScript::include( const Arguments& args )
{
boost::filesystem::path parentPath = scriptPath.parent_path();
//v8::String::Utf8Value fileName(args[i]);
std::string fileName = bea::Convert<std::string>::FromJS(args[0], 0);
//Add the script path to it
@tmpvar
tmpvar / .gitignore
Created July 12, 2011 07:19
A console.log implementation that plays "nice" with large amounts of data. It Keeps node alive until the output has flushed to the screen.
gmon.out
v8.log
@sixtenbe
sixtenbe / analytic_wfm.py
Last active May 27, 2024 01:24 — forked from endolith/peakdet.m
Peak detection in Python
#!/usr/bin/python2
# Copyright (C) 2016 Sixten Bergman
# License WTFPL
#
# This program is free software. It comes without any warranty, to the extent
# permitted by applicable law.
# You can redistribute it and/or modify it under the terms of the Do What The
# Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@paulmillr
paulmillr / dart.md
Last active July 15, 2023 13:36
Leaked internal google dart email

---------- Forwarded message ----------

From: Mark S. Miller <erights@google.com>
Date: Tue, Nov 16, 2010 at 3:44 PM
Subject: "Future of Javascript" doc from our internal "JavaScript Summit"
last week
To: javascript-standard@google.com
@greeness
greeness / gist:1498382
Created December 19, 2011 18:53
random projection lsh with random number from a pre-generated pool
import numpy
import math
# LSH signature generation using random projection
def get_signature(user_vector, rand_proj):
res = 0
for p in (rand_proj):
res = res << 1
val = numpy.dot(p, user_vector)
if val >= 0:
@methane
methane / gist:2185380
Created March 24, 2012 17:28
Tornado Example: Delegating an blocking task to a worker thread pool from an asynchronous request handler
from time import sleep
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from tornado.web import Application, asynchronous, RequestHandler
from multiprocessing.pool import ThreadPool
_workers = ThreadPool(10)
def run_background(func, callback, args=(), kwds={}):
def _callback(result):