Skip to content

Instantly share code, notes, and snippets.

# http://stackoverflow.com/questions/19991445/run-an-ols-regression-with-pandas-data-frame
import pandas as pd
import statsmodels.formula.api as sm
df = pd.DataFrame({"A": [10,20,30,40,50], "B": [20, 30, 10, 40, 50], "C": [32, 234, 23, 23, 42523]})
result = sm.ols(formula="A ~ B + C", data=df).fit()
print result.params
print result.summary()
@ewalk153
ewalk153 / ca.conf
Created September 21, 2015 01:12
Setup command to generate X509 keys for Xero.
[ req ]
prompt = no
default_bits = 2048
default_keyfile = flatbook.co.key
encrypt_key = no
distinguished_name = req_distinguished_name
#string_mask = utf8only
#req_extensions = v3_req

Here is a quick rundown of the tools that we use to collaborate and win at efficiency.

Company wide for Collaboration and Productivity

  • Asana for task management, planning, full replacement for internal email
  • Gmail for email
  • Google docs for sheets, word, powerpoint (supplemented by MS office for a few computers if you need to collaborate with lawyers etc)
  • Slack for real-time chatting, channel for each project
  • Expensify - simplify expense receipt filing
  • Xero - Web accounting system, that will scale normally up to ~10m of revenue, or maybe more.
pip3 install jupyter
jupyter notebook
# now, you have a web server running with jupyter!
@ewalk153
ewalk153 / git-find-commit
Created October 12, 2017 15:26
Command line script to find a specific commit
#!/usr/bin/env ruby
#find a commit from a file and a line
require 'optparse'
options = {}
OptionParser.new do |opts|
opts.banner = "Usage: #{$0} [options] filename:linenumber"
opts.on("-l") do |v|
console.log('done');
@ewalk153
ewalk153 / config-application.rb
Created January 2, 2020 21:17
debugging middleware
Dir["./app/middleware/*.rb"].each do |file|
require file
end
config.middleware.use(::DebugMiddleware)
@ewalk153
ewalk153 / micro_mandelbrot.py
Created September 1, 2020 01:59
Mandelbrot set, on Micropython Makerfab
# this will be the mandelbrot set, written in python
import sys
import machine
import st7789py as st7789
import random
from machine import Pin
def scale_x(px):
#scaled x coordinate of pixel (scaled to lie in the Mandelbrot X scale (-2.5, 1))
return -2.5 + px * 3.5 / 239
@ewalk153
ewalk153 / be.cfg
Created May 17, 2021 00:41
Basic config for cc65 compiler
MEMORY
{
ROM: start=$8000, size=$8000, type=ro, define=yes, fill=yes, file=%O;
}
SEGMENTS
{
CODE: load=ROM, type=ro;
VECTORS: load=ROM, type=ro, offset=$7ffa;
}
@ewalk153
ewalk153 / add-to-gcalendar-stimulus.html
Last active September 23, 2021 01:29
Add to calendar example with stimulus
<html>
<head>
<script src="https://unpkg.com/stimulus/dist/stimulus.umd.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>
<link
href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css"
rel="stylesheet"
/>
<script>