Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View amandabee's full-sized avatar

Amanda Hickman amandabee

View GitHub Profile
@amandabee
amandabee / action.php
Last active August 29, 2015 14:17
PHP Form Action Demo (See it in action at http://freegreentea.info/form/)
<?php
if(isset($_POST['submit'])) {
echo "<pre>";
// Everything that was entered into the form lives in an associative array called $_POST
// Guess what the array is called if you used GET as your form action?
print_r($_POST);
// You can create a new variable by stringing together strings and variables.
$new_url = "http://" . $_POST['something_unique'] . "/more_strings";
print($new_url);
// You can also continue to append things to that URL, with ".="
Country El Salvador Guatemala Honduras
FY 2009 1221 1115 968
FY 2010 1910 1517 1017
FY 2011 1394 1565 974
FY 2012 3314 3835 2997
FY 2013 5990 8068 6747
FY 2014 16404 17057 18244
FY 2015 1797 3548 951
@amandabee
amandabee / cartodb.html
Last active August 10, 2023 17:43
Bootstrap Demos
<iframe width='100%' height='520' frameborder='0' src='http://aaronsimon.cartodb.com/viz/2df91922-bba1-11e4-9f40-0e0c41326911/embed_map' allowfullscreen webkitallowfullscreen mozallowfullscreen oallowfullscreen msallowfullscreen></iframe>
@amandabee
amandabee / use_git.md
Last active August 29, 2015 14:03
You should use Git

Git is a version control system. Github is a proprietary hosting service that manages central git repositories. A git repository doesn't have to be public, but there are some great free hosts available if you do want to make your work available. Github, obviously, or Gitorious, especially if you're offended by github's ugly gender politics. Github's GUI is much nicer than any generalized Git GUI's I've seen, which is a vote for using Github, but it really doesn't matter.

So here are a few good reasons you should use git to manage teaching materials:

  • Greg Wilson explains it pretty well to a Python conference. You have to listen to him talk about a few other things first, but the whole talk is interesting so go ahead.

Any newsroom with an

@amandabee
amandabee / Calls to 911.R
Last active August 29, 2015 14:00
A handful of miscellaneous R scripts
## Load the file into a dataframe
calls.to.911 <- read.csv('/tmp/Calls_for_Service_2013.csv')
calls.to.911 <- read.csv('Calls_for_Service_2013.csv')
## Try `table` to summarize the data
table(calls.to.911$DispositionText)
## Make a few new frames out of those tables
disposition.summary <- as.data.frame(table(calls.to.911$DispositionText))
@amandabee
amandabee / README.md
Last active August 29, 2015 13:57 — forked from andrewxhill/README.md
CartoDB Advanced Infowindow Design

Advanced Infowindow Design

Getting Started

In this section, we will show you the advanced methods for controlling infowindows styles using the CartoDB interface. These skills will allow you to have highly customized infowindows for your published maps, created directly on your account. You don't need any programming skills to edit infowindows and you can see a tutorial of basic methods here. This section is about advanced methods and you will be required to use basic skills in HTML and later CSS.

Editing Infowindow HTML

CartoDB gives you direct access to the HTML that controls the layout of your infowindows. If you don't feel ready to edit HTML and CSS see the tutorial of basic methods. In CartoDB you can find the advanced editor by selecting the Infowindow Wizard and then clicking the small code tag in the upper right.

@amandabee
amandabee / tidy_by_type.sh
Last active August 29, 2015 13:56
Run preferred syntax checker for each file type.
#!/bin/sh
# [Gedit Tool]
# Save-files=document
# Shortcut=<Primary><Shift>bar
# Output=replace-document
# Name=Tidy by filetype
# Applicability=all
# Input=document
@amandabee
amandabee / README.md
Last active August 29, 2015 13:56
A handful of pretty random python scripts.

Just ... some scripts. Nothing special.

# Conky settings #
background no
update_interval 1
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
double_buffer yes
no_buffers yes
text_buffer_size 2048
@amandabee
amandabee / Filecounter.sh
Created June 21, 2012 18:21
First stab at finding directories with a lot of files in them.
#!/bin/bash
## If your first variable is a path to a directory that exists, we'll search
## there instead of wherever you are.
## If you set a second variable that is a number, we'll use that as the cap.
if [[ $2 = *[[:digit:]]* ]]; then
CAP=$2
else
CAP=600