Skip to content

Instantly share code, notes, and snippets.

View cycomachead's full-sized avatar
status

Michael Ball cycomachead

status
View GitHub Profile
import urllib2
from cookielib import CookieJar
cj = CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
# login to Piazza.
login_url = 'https://piazza.com/logic/api?method=user.login'
login_data = '{"method":"user.login","params":{"email":"alockwoo@andrew.cmu.edu","pass":"fakePassword"}}'
@cycomachead
cycomachead / cloud.js
Created June 27, 2014 21:26
Snap Cloud Questions
/*
cloud.js
a backend API for SNAP!
written by Jens Mönig
Copyright (C) 2014 by Jens Mönig
# This is weird logic to handle both an API request and an HTML request in 1 file. Some places we have 2 files which is even less dry.
# :majorsadface:
# In our sessions controller
# DELETE /api/users/logout
def destroy
respond_to do |format|
format.json {
@cycomachead
cycomachead / lti_rails_engine_template.rb
Created March 17, 2016 22:19 — forked from coderberry/lti_rails_engine_template.rb
Rails template for creating LTI apps (as mountable rails engines)
# rails plugin new my_lti_app -T --mountable --dummy-path=spec/test_app -m URL_TO_THIS_RAW_GIST
def ask_wizard(question)
ask "\033[1m\033[30m\033[46m" + "prompt".rjust(10) + "\033[0m\033[36m" + " #{question}\033[0m"
end
def yes_wizard?(question)
answer = ask_wizard(question + " \033[33m(y/n)\033[0m")
case answer.downcase
when "yes", "y"
@cycomachead
cycomachead / cer.md
Created November 1, 2016 09:33 — forked from amyjko/cer.md

Computing education research (CER) is the study of how people learn computing and the invention of better ways to teach computing. This FAQ will teach you more more about the field and how you might contribute to it.

What is computing education research?

First, CER is not teaching. Teaching is helping people acquire knowledge, skills, attitudes and beliefs. Research is discovering truth and inventing solutions. Teachers teach computing, whereas computing education researchers discover what is true about the teaching and learning of computing, and invent new techniques for teaching and assessing it (some pedagogical, some computational).

It's also important to note that I construe "computing" broadly: it's not just about programming, or even just about computer science, but also about all of the phenomena surrounding computing (including privacy, security, information ethics, software engineering, etc.). This means that computing education and computing education research can and do cover far more t

@cycomachead
cycomachead / gist:94db03f4bf66a1e3fd63aeb9b1261cb4
Created November 10, 2016 22:01 — forked from kylefox/gist:4512777
If you want to use Xcode's FileMerge as your git mergetool, this is how you set it up.
# Tell system when Xcode utilities live:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
# Set "opendiff" as the default mergetool globally:
git config --global merge.tool opendiff
@cycomachead
cycomachead / color_contrast.js
Last active April 5, 2017 22:51
Testing W3C Color Contrast
/*
Color Contrast
Implement WCAG's Color Contrast formula
Designed to take in hex color codes:
ratio('000000', 'FFFFFF') → 21 is the defined ratio between white and black
*/
// Convert hex to number
// Decimal should be a float [0, 1.0]
let hex2int = (str) => parseInt(str, 16);

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@cycomachead
cycomachead / README.md
Created August 18, 2017 09:31 — forked from yorkxin/README.md
Amazon S3 Redirect Rules Generator

Amazon S3 Redirect Rules Generator

A Ruby script to generate simple Amazon S3 Redirection Rules XML file.

Update: There is an app for that now! Use Amazon S3 Redirector (Web app) and you can generate the XML without any knowledge about Ruby. Thanks to @rainforestapp. BTW, It's open source too.

Dependencies

  • Nokogiri
@cycomachead
cycomachead / Gradescope Hacks.md
Last active February 25, 2018 16:25
Bookmarklets and scripts for tweaking gradescope.com

Gradescope Hacks

This is a collection of bookmarklets and scripts that you can use to adapt Gradescope to do (currently) unsupported things. Unless otherwise noted, make a new bookmark, then set it's link/URL to the code for each hack.

Directions

To make a new bookmarklet, create a new bookmark in your browser, then use the edit functionality to set the URL. Make sure to include the full text starting with "javascript:". When you click that bookmark while on the page it will prompt you and then do its thing. :) (Nothing should happen on any page that isn't the right one.)

Warning: These are subject to break at any time. :-)