This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pandas as pd | |
from struct import unpack, calcsize | |
from collections import namedtuple | |
def parse_scid_file(filename): | |
SIERRA_CHART_EPOCH = pd.to_datetime('1899-12-30') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import pandas as pd | |
import yfinance as yf | |
symbols = pd.read_csv('ftp://ftp.nasdaqtrader.com/symboldirectory/nasdaqtraded.txt', delimiter='|') | |
# Excluded symbols: | |
# - Test symbols | |
# - ETFs | |
# - Financial status: Other than Normal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fs = require 'fs' | |
{Transform} = require 'stream' | |
class Reverser extends Transform | |
_transform: (data, encoding, done) -> | |
@push data.toString().split('').reverse().join '' | |
done() | |
class UpperCaser extends Transform | |
_transform: (data, encoding, done) -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bin/ansible:#!/usr/bin/env python | |
bin/ansible-doc:#!/usr/bin/env python | |
bin/ansible-galaxy:#!/usr/bin/env python | |
bin/ansible-playbook:#!/usr/bin/env python | |
bin/ansible-pull:#!/usr/bin/env python | |
docsite/build-site.py:#!/usr/bin/env python | |
examples/scripts/uptime.py:#!/usr/bin/python | |
hacking/module_formatter.py:#!/usr/bin/env python | |
hacking/test-module:#!/usr/bin/env python | |
lib/ansible/runner/action_plugins/synchronize.py:#!/usr/bin/python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from sys import * | |
import xlrd | |
import csv | |
def to_utf8(val): | |
if isinstance(val, basestring): | |
return val.encode('utf-8') | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
search: ({query: {q}}, res) => | |
@collection.then((coll) -> | |
coll.find(key: new RegExp(q, 'i')) | |
.sort(_id: -1) | |
.limit(20) | |
.stream() | |
.pipe(JSONStream.stringify()) | |
.pipe(res)) | |
.done() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
express = require 'express' | |
http = require 'http' | |
app = express() | |
app.get '/hello', (_, res) -> res.send "Hello world!" | |
http.createServer(app).listen 3000 | |
http.createServer(app).listen 3010 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reduce = (f, initial) -> (xs) -> Array::reduce.call xs, f, initial | |
butlast = (xs) -> xs.slice 0, xs.length - 1 | |
sum = (x, y) -> x + y | |
addInputStream = (xs) -> | |
input = $('<input />') | |
.appendTo('#inputs') | |
.asEventStream('input') | |
.map('.target.value') | |
.map(parseInt) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = class FooController | |
get: ({params: {foo}}, res) -> | |
get("http://localhost:9292/api/#{foo}.json") | |
.then (response) -> | |
res.status response.status | |
if response.status == 200 | |
then res.end JSON.stringify transformResponse response.body | |
else res.end response.text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// james-coffee/index.js | |
var james = require('james'), | |
coffee = require('coffee-script'); | |
coffee.createStream = function() { | |
return james.createTransformation(function(content, callback) { | |
// Process the file content and call the callback with the result. | |
try { | |
res = coffee.compile(content); |
NewerOlder