xkcd-style Pollster charts
Code via http://dan.iel.fm/xkcd
int GetInt(void) | |
{ | |
// try to get an int from user | |
while (true) | |
{ | |
// get line of text, returning INT_MAX on failure | |
string line = GetString(); | |
if (line == NULL) | |
{ | |
return INT_MAX; |
d3.jsonp.foo('Hello, World!'); |
xkcd-style Pollster charts
Code via http://dan.iel.fm/xkcd
Input JSON:
{
"fleet":{
"MVVSYUagG6":{
"shift-end":"9:00",
"shift-start":"0:00",
"start-location":"depot"
},
"LC0Ux5hmUR":{
/Applications/Xcode.app/Contents/MacOS/Xcode </dev/null &>/dev/null & |
# in model | |
validates :admin, :inclusion => { :in => [true, false] } | |
# the test | |
it "rejects invalid admin state" do | |
non_admin_user = User.new(@attr.merge(:admin => "is administrator")) | |
non_admin_user.should_not be_valid | |
end |
// | |
// MasterViewController.m | |
// ShoeEngine | |
// | |
// Created by Chris Anderson on 4/19/12. | |
// Copyright (c) 2012 The Winston Group. All rights reserved. | |
// | |
#import "MasterViewController.h" |
What up gist! |
To set the root user password. From terminal.
/usr/local/Cellar/mysql/5.5.20/bin/mysqladmin -u root password 'enter_a_password'
Then do
mysql --user=root --password=enter_a_password
In the mysql command prompt:
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>ThinAuth</title> | |
<link href="/assets/application-7270767b2a9e9fff880aa5de378ca791.css" media="all" rel="stylesheet" type="text/css" /> | |
<script src="/assets/application-990a4cf0df42934fcc4c14aaf88b7ced.js" type="text/javascript"></script> | |
<meta content="authenticity_token" name="csrf-param" /> | |
<meta content="1W3NM3IJuIgxScltwWBmilWuuCQhcKMFV3jULKoPUNA=" name="csrf-token" /> | |
</head> |