Skip to content

Instantly share code, notes, and snippets.

View mattbis's full-sized avatar

Matthew mattbis

View GitHub Profile
import exoplanet as xo
import pymc3 as pm
import numpy as np
import matplotlib.pyplot as plt
import theano.tensor as tt
with pm.Model() as model:
ecs = xo.UnitDisk("ecs", testval=np.array([1e-5, -1.e-5]))
ecc = pm.Deterministic("ecc", tt.sqrt(tt.sum(ecs ** 2)))
omega = pm.Deterministic("omega", tt.arctan2(ecs[1], ecs[0]))
@Lampsy
Lampsy / FuelConsumption.csv
Created May 9, 2020 16:54
Created on Skills Network Labs
MODELYEAR MAKE MODEL VEHICLECLASS ENGINESIZE CYLINDERS TRANSMISSION FUELTYPE FUELCONSUMPTION_CITY FUELCONSUMPTION_HWY FUELCONSUMPTION_COMB FUELCONSUMPTION_COMB_MPG CO2EMISSIONS
2014 ACURA ILX COMPACT 2 4 AS5 Z 9.9 6.7 8.5 33 196
2014 ACURA ILX COMPACT 2.4 4 M6 Z 11.2 7.7 9.6 29 221
2014 ACURA ILX HYBRID COMPACT 1.5 4 AV7 Z 6 5.8 5.9 48 136
2014 ACURA MDX 4WD SUV - SMALL 3.5 6 AS6 Z 12.7 9.1 11.1 25 255
2014 ACURA RDX AWD SUV - SMALL 3.5 6 AS6 Z 12.1 8.7 10.6 27 244
2014 ACURA RLX MID-SIZE 3.5 6 AS6 Z 11.9 7.7 10 28 230
2014 ACURA TL MID-SIZE 3.5 6 AS6 Z 11.8 8.1 10.1 28 232
2014 ACURA TL AWD MID-SIZE 3.7 6 AS6 Z 12.8 9 11.1 25 255
2014 ACURA TL AWD MID-SIZE 3.7 6 M6 Z 13.4 9.5 11.6 24 267
@remzmike
remzmike / replace-leading-spaces-with-tabs.py
Last active May 9, 2020 18:20
quick replace leading spaces with tabs
import os
import time
dirnames = ['classes', 'triggers']
timestamp = '%s' % time.time()
for dirname in dirnames:
for fname in os.listdir(dirname):
fpath = os.path.join(dirname, fname)
#!/usr/local/bin/python3
######################################################################################################################
# Purpose: Generate rule report of all the security groups #
# Input Params: None # #
# Author: Ramesh #
# Doc. Ref: http://boto3.readthedocs.io/en/latest/reference/services/ec2.html#EC2.Client.describe_security_groups#
######################################################################################################################
from __future__ import print_function
async uploadVideo ({ request }) {
const video = request.file('video');
await video.move(Helpers.tmpPath('uploads'), {
name: 'video.mp4',
overwrite: false,
});
if (!video.moved()) {
return video.error();
@maia-18
maia-18 / PY0101EN-5-2-Numpy2D.ipynb
Created May 9, 2020 16:33
Created on Skills Network Labs
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@donrestarone
donrestarone / stats.sh
Last active May 9, 2020 17:09
check system stats in ubuntu
#show memory speed
sudo lshw -short -C memory
# check core frequencies
watch -n.1 "cat /proc/cpuinfo | grep \"^[c]pu MHz\""
#run stress test
stress --cpu 12 --io 8 --vm 8 --vm-bytes 1024M --timeout 100s
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
function binarySearch(arr, item) {
let startIndex = 0;
let endIndex = arr.length - 1;
while (startIndex < endIndex) {
let middleIndex = Math.floor((startIndex + endIndex) / 2);
if (arr[middleIndex] === item) {
return `Found at index ${middleIndex}`;
}
@siddharththakur26
siddharththakur26 / StockPrices.py
Created May 9, 2020 16:26
TestDome-DataScience
import pandas as pd
import numpy as np
def most_corr(prices):
"""
:param prices: (pandas.DataFrame) A dataframe containing each ticker's
daily closing prices.
:returns: (container of strings) A container, containing the two tickers that
are the most highly (linearly) correlated by daily percentage change.
"""