Skip to content

Instantly share code, notes, and snippets.

{
"metadata": {
"name": "Crowdstorming Project - S. Gordon-McKeon"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{

data.frame(data.frame(numbers=c(1,2,3)), data.frame(letters=c("a", "b", "c"))) makes a data frame:

  numbers letters
1       1       a
2       2       b
3       3       c

data.frame(data.frame(numbers=c(1,2,3)), data.frame(letters=c("a", "b", "c", "d"))) does not:

Error in data.frame(data.frame(numbers = c(1, 2, 3)), data.frame(letters = c("a", :

{
"metadata": {
"name": "Lennon or McCartney_"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{

Keybase proof

I hereby claim:

  • I am shaunagm on github.
  • I am shaunagm (https://keybase.io/shaunagm) on keybase.
  • I have a public key whose fingerprint is 0AAF 7651 0429 028A ECDD 6B04 0795 E848 E297 41C1

To claim this, I am signing this object:

https://github.com/shaunagm/actionrising/issues/52 Make a special page for 'event' actions. Will give you good overview of how Django works.
https://github.com/shaunagm/actionrising/issues/83 Formatting! Who doesn't love formatting?
https://github.com/shaunagm/actionrising/issues/109 (depends on how comfortable you are with HTML/Javascript/forms)
https://github.com/shaunagm/actionrising/issues/127 (design solution needs to be talked through with Shauna)
https://github.com/shaunagm/actionrising/issues/87 This has a list of several changes, some minor, some major. Need to talk through with Shauna.
https://github.com/shaunagm/actionrising/issues/101 Do you want to dive deep on how Django handles urls and views? Then this issue is for you!
Byte-sized tasks (currently assigned to Presley):
https://github.com/shaunagm/actionrising/labels/hypothetically%20bite-sized
# This alters initial, but initial isn't actually used in the form displayed
def __init__(self, *args, **kwargs):
super(UniversalForm, self).__init__(*args, **kwargs)
self.fields['always_reps'].widget = SelectMultiple(choices=[(i.pk, i.full_appellation()) for i in Legislator.objects.all()])
if self.instance.always_reps:
self.initial = {'always_reps': self.instance.get_always_reps()}
# This gives me an error because I don't have access to self.instance before calling super
@shaunagm
shaunagm / codechecklist.md
Last active November 27, 2018 16:47
Code Checklist

All code should:

Tests

  • unit tests covering all functionality
  • integration tests where necessary

Documentation

  • docstrings on every class, and every method > 2 lines long
# Subclassing -- not ideal in Django because PythonProgrammer object will have data stored in Programmer
# and Worker since they are concrete, not abstract
class Human(object):
name = "Eve"
Meta:
abstract = True
def get_human_data(self):
@shaunagm
shaunagm / lisp_parser.py
Created February 23, 2018 02:58
A simple lisp parser
import csv
input = ""
with open('example.lsp', 'r') as input_file:
for line in input_file:
if line[0] is not ";":
input += line
def parse(input):
@shaunagm
shaunagm / wtf_is_ops.md
Last active March 16, 2018 19:54
intro to ops for developers

If you're a developer who hasn't done much work with operations, it can be quite confusing! After spending several days reading documentation and tutorials, I decided to write the overview I wish I'd been handed at the beginning. This guide starts with a simple example - running a Django app on your laptop - and works up to running automated deployments of multiple instances simultaneously on Amazon Web Services.

I learn by working with concrete examples, so this guide makes a lot of arbitrary technology choices as it goes. Obviously this guide will work best if you're familiar with Django and interested in AWS, but hopefully it's still somewhat useful for a Rails developer who wants to use Azure or what have you.

Of course, I may well be missing key concepts or have gotten something very wrong. Any comments, feedback, etc are appreciated.

Okay, let's get started.

Deploying your web app