Skip to content

Instantly share code, notes, and snippets.

View spmacdonald's full-sized avatar

Scott MacDonald spmacdonald

View GitHub Profile
@jmatsushita
jmatsushita / README
Last active July 16, 2024 10:30
Setup nix, nix-darwin and home-manager from scratch on an M1 Macbook Pro
###
### [2023-06-19] UPDATE: Just tried to use my instructions again on a fresh install and it failed in a number of places.
###. Not sure if I'll update this gist (though I realise it seems to still have some traffic), but here's a list of
###. things to watch out for:
### - Check out the `nix-darwin` instructions, as they have changed.
### - There's a home manager gotcha https://github.com/nix-community/home-manager/issues/4026
###
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs).
# So here's a minimal Gist which worked for me as an install on a new M1 Pro.
@gene1wood
gene1wood / aws-lambda-relative-import-no-known-parent-package.md
Last active July 9, 2024 11:09
Python relative imports in AWS Lambda fail with `attempted relative import with no known parent package`

Python relative imports in AWS Lambda fail with attempted relative import with no known parent package

The Problem

In AWS Lambda if I attempt an explicit relative import like this

.
├── lambda_file.py
└── example.py
@yefim
yefim / Dockerrun.aws.json
Last active April 7, 2023 16:11
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "443"
}
@vasanthk
vasanthk / System Design.md
Last active July 24, 2024 23:02
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@TomAugspurger
TomAugspurger / to_redshift.py
Last active September 16, 2021 16:55
to_redshift.py
# see also https://github.com/wrobstory/pgshift
import gzip
from io import StringIO, BytesIO
from functools import wraps
import boto
from sqlalchemy import MetaData
from pandas import DataFrame
from pandas.io.sql import SQLTable, pandasSQL_builder
@joyrexus
joyrexus / README.md
Last active November 4, 2021 07:15
crossfilter ui for timeseries data

The aim is to develop a simple generic crossfilter interface for timeseries data. The tag line for crossfilter applies: we want fast multidimensional filtering with coordinated views.

We'd like a consistent ui for visualizing/querying/filtering all columns with visual summarizers/selectors appropriate to a column's type (e.g., brushable histograms for numeric types, selectable histograms for enumerated types, typeahead keyword search for text, etc.).

I'd like it to be useful primarily as a table filter and query tool, but provide simple summary visualizations and statistics of the current selection. As in the various crossfilter demos, any data visualization should also function as part of the query interface.

@ibeex
ibeex / foo.log
Created August 4, 2012 13:46
Flask logging example
A warning occurred (42 apples)
An error occurred
@timelyportfolio
timelyportfolio / construction of horizon plot in r.r
Created August 1, 2012 20:20
construction of horizon plot
#look at steps in constructing a horizon plot version
#of http://www.mebanefaber.com/timing-model/
#do horizon of percent above or below 10 month / 200 day moving average
require(lattice)
require(latticeExtra)
require(quantmod)
#since we are focused on the horizon plot, let's just look at one stock
var Rx = require('./rx.node')
, twitter = require('ntwitter')
, credentials = require('./credentials')
, io = require('socket.io').listen(80);
var customBind = function (self, method) {
return function () {
return self[method].apply(self, arguments);
};
};