This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Nick's Ferrari | |
from urllib import urlopen | |
f = urlopen('http://www.textfiles.com/art/ferrari.art') | |
ferrari = f.read() | |
print '' | |
print ferrari |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Chartbeat = function(opts) { | |
if (!opts) | |
throw new Error("Chartbeat: Please specify an api key and host!"); | |
if (!opts.api_key) | |
throw new Error("Chartbeat: Please specify an api key!"); | |
if (!opts.host) | |
throw new Error("Chartbeat: Please specify a host!"); | |
this.creds = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Check for thumb of $size and generate it if it doesn't exist. | |
* | |
* @param int $post_id Post ID for which you want to retrieve thumbnail | |
* @param string $size Name of thumbnail size to check for; same as | |
* the slug used to add custom thumb sizes with add_image_size(). | |
* @return array An array containing: array( 0 => url, 1 => width, 2 => height ) | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var $ = jQuery; | |
var Carousel = function(element, params) { | |
this.init = function(element, params) { | |
if ( !(this instanceof Carousel) ) | |
return new Carousel(element, params); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_____ ___ _ __ __ | |
|_ _| __| /_\ | \/ | | |
| | | _| / _ \| |\/| | | |
|_|_|___/_/_\_\_| |_| | |
|_ _| _ \_ _| _ ) | |
| | | /| || _ \ | |
|_| |_|_\___|___/ | |
/_\ | _ \ _ \/ __| | |
/ _ \| _/ _/\__ \ | |
/_/ \_\_| |_| |___/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Create a local copy of a website, suitable | |
# for upload to S3 as a static archive. | |
# | |
# Provide the domain name you wish to archive | |
# as the first argument. | |
# | |
# For example: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from boto import connect_s3 | |
from boto.exception import S3ResponseError | |
from boto.s3.key import Key | |
from config import AWS_SECRET_ACCESS_KEY, AWS_ACCESS_KEY_ID, S3_BUCKET | |
bucket_name = S3_BUCKET | |
conn = connect_s3(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var clients = Array(10), | |
url = 'http://localhost:5000/'; | |
var on = function(resource) { | |
if (resource.url.match('data.json')) | |
this.echo("[update] Received: " + resource.url, 'INFO'); | |
}; | |
var start = function() { | |
if (this.resourceExists('data.json')) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ObligationDebtChartView = ChartView.extend({ | |
constructor: function(options) { | |
ChartView.apply(this, arguments); | |
this.create_tooltip(); | |
this.$chart_container.attr('id', 'debt-chart-container'); | |
return this; | |
}, | |
draw: function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Original author: David Eads (https://github.com/eads) | |
* | |
* Wrap D3 charting components in a simple Backbone view interface | |
* | |
* Provides a redrawing path, data sync, and fallback for non-d3 browsers. | |
* | |
* Views that extend ChartView should implement their own "draw" function and go to work. | |
* | |
* var collection = new Backbone.Collection([ ["Maria", 33], ["Heather", 29] ]); |
OlderNewer