Skip to content

Instantly share code, notes, and snippets.

body {
margin: 0;
}
body img {
width: 100%;
}
@nathancahill
nathancahill / median.py
Created September 13, 2013 21:24
Find the median of a list of values.
import argparse
import numpy
parser = argparse.ArgumentParser(description='Find the median of a list of values.')
parser.add_argument('values', metavar='N', type=float, nargs='+')
args = parser.parse_args()
values = args.values
values.sort()
#props li {
background-color: #EBEBEB;
margin: 0 15px 30px 0;
width: 235px;
color: #333333;
float: left;
list-style: none outside none;
line-height: 18px;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 13px;
<?php
$json = file_get_contents('http://stage.prope.rs/api/<account_name>/3');
$props = json_decode($json, TRUE);
foreach ($props as $prop) {
$template = "<li>
<div class='quote'>%s</div>
<div class='speech_tag'></div>
<div class='image'><img width='42' height='42' src='%s'></div>
<div class='author'>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script>
$(document).ready(function(){
$.getJSON('http://stage.prope.rs/api/<account_name>', function(props) {
$(props).each(function(id) {
root = $('<div />').addClass('prop').append(
'<span class="text" />',
'<span class="name" />',
@nathancahill
nathancahill / testing.html
Created September 10, 2012 20:11
testing
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Embedly - Embed - Example</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
<script type="text/javascript" src="../jquery.embedly.js"></script>
<style>
BODY {background-color:#333333;}
#content{background-color:#FFFFFF;margin:0 auto;width:800px;}
@nathancahill
nathancahill / hncomments_ajax.js
Created July 24, 2012 09:02
Hacker News comments load via Ajax
$(document).ready(function() {
$.ajax({
url: 'http://hncomments.nathancahill.com/comments/link-id/html/',
success: function(data) {
$('#hncomments').append(data);
}
});
});
@nathancahill
nathancahill / hncomments.css
Created July 24, 2012 08:38
Hacker News comments stylesheet
#hncomments div {
margin-left: 40px;
font-family: Verdana;
line-height: 130%;
}
.comment {
font-size: 9pt;
}
.comment a {
color: #000000;
@nathancahill
nathancahill / comment_format.html
Created July 24, 2012 05:31
Hacker News comment format
<div data-depth="0" class="comment">
<span class="user">
<a href="http://news.ycombinator.com/user?id=username">username</a>
</span>
<span class="timestamp">6 hours ago</span>
<br>
<p class="text">Comment</p>
<a href="http://news.ycombinator.com/item?id=reply_id" class="reply">reply</a>
</div>