Skip to content

Instantly share code, notes, and snippets.

<html>
<head>
<style>
html,body {
padding: 0;
margin: 0;
}
#left-paddle {
background-color: green;
<html>
<head>
<style>
#checker-board {
width: 400px;
height: 400px;
background-color: #ffbc00;
border: 10px solid rgba(0,0,0,0.65);
border-radius: 10px;
position: relative;
@mjumbewu
mjumbewu / index.html
Created April 7, 2016 20:36
JS Sentry Config in a Django template
{% if settings.SENTRY_DSN %}
<script src="https://cdn.ravenjs.com/2.2.0/raven.min.js"></script>
<script>Raven.config('{{ settings.SENTRY_DSN }}').install()</script>
<script>
$(document).ajaxError(function(event, jqXHR, ajaxSettings, thrownError) {
Raven.captureMessage('Ajax: (' + jqXHR.status + ') "' + thrownError || jqXHR.statusText + '" at ' + ajaxSettings.url, {
extra: {
type: ajaxSettings.type,
url: ajaxSettings.url,
data: ajaxSettings.data,
@mjumbewu
mjumbewu / bullet-voting.json
Created October 8, 2015 18:33
Bullet Voting
{
"version": "1",
"header": {
"title": "Business Licenses in Chicago",
"description": "Business licenses issued by the Department of Business Affairs and Consumer Protection in the City of Chicago from 2002 to the present. January 1, 2006 to present. Data is updated daily.",
"navigation": [
{
"label": "Download",
"url": "https://data.cityofchicago.org/api/views/r5kz-chrr/rows.csv?accessType=DOWNLOAD&bom=true"
}
@mjumbewu
mjumbewu / index.html
Last active September 24, 2015 18:08
Mapbox GL test
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.11.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.11.0/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@mjumbewu
mjumbewu / Gruntfile.js
Created September 8, 2015 07:45
Starter Gruntfile
module.exports = function(grunt) {
// Do grunt-related things in here
};
@mjumbewu
mjumbewu / README.md
Last active August 29, 2015 14:17
Thoughts on the usage of GitHub as a tool for CbK

Coded By Kids ❤ GitHub

GitHub may turn out to be a great resource for tracking kids' progress on projects. Commit messages can form the basis of a progress journal, as well as a built-in point of reflection after each session. Students can use them to summarize the work completed during the session. Volunteer instructors can refer back through the commit history to see kids process as they have been working on a project. Using the web interface and gh-pages may be a good, gentle introduction before getting into the command line.

Good Git tutorials & resources

class NewAlbum:
def leastAmountOfCDs(self, nSongs, length, cdCapacity):
# First, for kicks, let's just check whether all the songs fit on
# one CD
totalLength = nSongs * length
if totalLength <= cdCapacity:
return 1
# If all the songs don't fit on one CD, start iterating through the
@mjumbewu
mjumbewu / instructions.md
Last active August 29, 2015 14:14
Create a settings context processor in Django

Create a file called context_processors.py, and insert this:

from django.conf import settings as django_settings

def settings(request):
    return {'settings': django_settings}

Then, in settings.py, add this:

@mjumbewu
mjumbewu / filtered_data.handlebars
Created September 9, 2014 15:51
Filter both places and comments by properties on the places
{{#created_within_days 365 dataset.places}}
{{!-- Filter the places by some property --}}
{{#filter_by . "properties.location_type" "park"}}
Number of new places: {{length .}}
{{#each .}} ... {{/each}}
{{/filter_by}}
{{/created_within_days}}