Skip to content

Instantly share code, notes, and snippets.

@elyase
elyase / yahoo.ipnb
Created October 1, 2014 11:06
download stocks symbols specified in a text file from Yahoo
{
"metadata": {
"name": "",
"signature": "sha256:42134ad8f5b08de55437d93a2e23cb1ca3217608d1d8cc35d7768fe256c96c11"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@elyase
elyase / quartz_event_taps
Created September 21, 2014 10:11
QuartztEvent Taps
import Quartz
from AppKit import NSKeyUp, NSSystemDefined, NSEvent
def keyboardTapCallback(proxy, type_, event, refcon):
# Convert the Quartz CGEvent into something more useful
if type_ < 0 or type_ > 0x7fffffff:
print "----- Timed out -----"
print NSEvent.eventWithCGEvent_(event)
return event
keyEvent = NSEvent.eventWithCGEvent_(event)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from math import sin, cos, pi
l = list()
for alpha in np.linspace(0,90,90):
alpha = alpha*pi/180 # plane angle in radians
R = np.matrix([ [cos(alpha) , 0, sin(alpha)],
[0 , 1, 0],
[-sin(alpha), 0, cos(alpha)] ])
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
------ Begin Next Fly'm ------
"Begin Fly'm (Mon Mar 03 18:15:46 2014)"
"Ion N","Events","TOF","Mass","Charge","X","Y","Z","Vt","B","Bx","By","Bz"
1,4,8.66971,99,1,69.2607,92.6018,1840,279.259,0.10056,-0.00732981,-0.0916362,-0.0407612
2,4,8.67301,99,1,69.7009,91.0858,1840,279.173,0.0992598,-0.00733109,-0.0902476,-0.040671
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2014-01-22T19:14:49.158429+00:00 heroku[web.1]: State changed from down to starting
2014-01-22T19:14:49.158064+00:00 heroku[web.1]: Unidling
2014-01-22T19:14:54.256439+00:00 heroku[web.1]: Starting process with command `gunicorn app:app`
2014-01-22T19:14:57.002691+00:00 app[web.1]: 2014-01-22 19:14:57 [2] [INFO] Starting gunicorn 18.0
2014-01-22T19:14:57.012043+00:00 app[web.1]: 2014-01-22 19:14:57 [2] [INFO] Listening at: http://0.0.0.0:28673 (2)
2014-01-22T19:14:57.017659+00:00 app[web.1]: 2014-01-22 19:14:57 [2] [INFO] Using worker: sync
2014-01-22T19:14:57.030090+00:00 app[web.1]: 2014-01-22 19:14:57 [7] [INFO] Booting worker with pid: 7
2014-01-22T19:14:57.421472+00:00 heroku[web.1]: State changed from starting to up
2014-01-22T19:14:58.176808+00:00 app[web.1]: Cubaofertas started
2014-01-22T19:14:58.503286+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=cubaofertas.herokuapp.com request_id=ab0523ee-2bff-4ec4-af95-01bf3332715c fwd="62.89.170.19" dyno=web.1 connect=2ms service=38ms status=