Skip to content

Instantly share code, notes, and snippets.

View ahmohamed's full-sized avatar

Ahmed Mohamed ahmohamed

View GitHub Profile
@ahmohamed
ahmohamed / README.md
Last active October 16, 2015 22:37
Specdraw: static mode

This example demonstrate using SpecdrawJS in static mode. This mode displays the spectrum but doesn't offer the user any interactivity with the data.

For details about SpecdrawJS.

For more examples see NMRPro.

@ahmohamed
ahmohamed / README.md
Last active October 16, 2015 22:37
Specdraw: read jcamp-dx file

This example demonstrate using SpecdrawJS to handle jcamp-dx files easily. Proton spectrum of indomethacin is obtained from a URL and processed in the browser. The App offers full interactivity with the data.

For details about SpecdrawJS.

For more examples see NMRPro.

@ahmohamed
ahmohamed / README.md
Last active October 16, 2015 22:37
Specdraw interactive view mode: 2D HSQC spectra of amygdalin

This example demonstrate using SpecdrawJS in interactive view mode. This mode is most suitable for spectral databases, as it allows zooming, viewing of multiple spectra (i.e datasets) in the same App. Interactive view mode doesn't support peak picking, integration, binning or saving spectra as images.

NB: Use mouse wheel (scroll) to zoom on the z-axis (intensify peaks in the spectrum).

For details about SpecdrawJS.

For more examples see NMRPro.

@ahmohamed
ahmohamed / README.md
Last active October 16, 2015 22:37
Specdraw full-client example: Adinosine sampleset

This example demonstrate using SpecdrawJS in full client-side mode. For details about SpecdrawJS. For more examples see NMRPro

@ahmohamed
ahmohamed / .block
Last active October 6, 2023 14:04
Create a reusable table using d3 and jquery DataTables
license: gpl-3.0
import struct
import SocketServer
from base64 import b64encode
from hashlib import sha1
from mimetools import Message
from StringIO import StringIO
class WebSocketsHandler(SocketServer.StreamRequestHandler):
magic = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
import numpy as np
from math import pi, log
import pylab
from scipy import fft, ifft
from scipy.optimize import curve_fit
i = 10000
x = np.linspace(0, 3.5 * pi, i)
y = (0.3*np.sin(x) + np.sin(1.3 * x) + 0.9 * np.sin(4.2 * x) + 0.06 *
np.random.randn(i))
@ahmohamed
ahmohamed / index.html
Last active August 29, 2015 14:15 — forked from mbostock/.block
Collision detection in transition
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<style>
path {
fill: none;
stroke: #000;
stroke-width: 3px;
}
@ahmohamed
ahmohamed / README.md
Last active January 31, 2023 23:26 — forked from mbostock/.block
D3.js: Panning with mouse wheel

This example demonstrate how to remap D3 events. MouseWheel event is used to pan the chart in x and y directions. This example was created as an answer to this SO question (Refer to it for detailed explanation).