This file contains 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
<cfcomponent output="false"> | |
<cffunction name="init" returntype="Twitter"> | |
<cfargument name="consumerKey" required="true"> | |
<cfargument name="consumerSecret" required="true"> | |
<cfargument name="authKey" type="string" required="false" default=""> | |
<cfargument name="authSecret" type="string" required="false" default=""> | |
<cfscript> | |
var local = {}; | |
This file contains 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
package itemrenderer | |
{ | |
import flash.events.MouseEvent; | |
import mx.controls.Button; | |
import mx.controls.Image; | |
import mx.controls.treeClasses.TreeItemRenderer; | |
import mx.controls.treeClasses.TreeListData; | |
public class CustomTreeItemRenderer extends TreeItemRenderer |
This file contains 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
@media only screen and (max-device-width: 800px) { | |
#wrap { | |
margin: 0; padding: 0; | |
width: 320px; | |
background: url(../../images/bg_header.png) repeat-x; | |
} | |
#header { | |
margin: 0 auto; padding: 15px 10px 0 0; | |
width: 320px; height: 116px; |
This file contains 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(){ | |
APP = {}; | |
APP.Views = {}; | |
APP.Models = {}; | |
_.extend(APP, Backbone.Events); | |
APP.Views.App = Backbone.View.extend({ | |
el: $('#body'), | |
initialize: function(){ |
This file contains 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
tpl = { | |
templates: {}, | |
loadTemplates: function (names, callback) { | |
var that = this; | |
var loadTemplate = function (index) { | |
var name = names[index]; |
This file contains 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 world = {"Africa":["Algeria","Angola","Benin","Botswana","Burkina","Burundi","Cameroon","Cape Verde","Central African Republic","Chad","Comoros","Congo","Djibouti","Egypt","Equatorial Guinea","Eritrea","Ethiopia","Gabon","Gambia","Ghana","Guinea","Guinea-Bissau","Ivory Coast","Kenya","Lesotho","Liberia","Libya","Madagascar","Malawi","Mali","Mauritania","Mauritius","Morocco","Mozambique","Namibia","Niger","Nigeria","Rwanda","Sao Tome and Principe","Senegal","Seychelles","Sierra Leone","Somalia","South Africa","South Sudan","Sudan","Swaziland","Tanzania","Togo","Tunisia","Uganda","Zambia","Zimbabwe"], | |
"Asia":["Afghanistan","Bahrain","Bangladesh","Bhutan","Brunei","Burma","Cambodia","China","East Timor","India","Indonesia","Iran","Iraq","Israel","Japan","Jordan","Kazakhstan","North Korea","South Korea","Kuwait","Kyrgyzstan","Laos","Lebanon","Malaysia","Maldives","Mongolia","Nepal","Oman","Pakistan","Philippines","Qatar","Russian Federation","Saudi Arabia","Singapore","Sri Lanka","Syria","Tajikistan","Thailan |
This file contains 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
class HomeController < ApplicationController | |
def index @posts = RSS::Parser.parse(open('http://johngag.tumblr.com/rss').read, false).items | |
end | |
end | |
<%= link_to post.title, post.link, :target => "_parent" %> | |
<%= render :partial => "home/post", :collection => @posts.first(5) %> |
This file contains 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
{% for post in latest_blog_posts %} | |
<div class="row"> | |
<div> | |
<h2 class="post-title"><a href="/blog/post/{{ post.id }}/">{{ post.title }}</a></h2> | |
<h5 class="post-date">{{ post.pub_date }} - {% for cat in post.category.all %}{{ cat.name }}{% if not forloop.last %},{% endif %}{% endfor %}</h5> | |
<p class="lead">{% autoescape off %}{{ post.content|safe }}{% endautoescape %}</p> | |
</div> | |
</div> | |
<hr> | |
{% endfor %} |
This file contains 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
class Category(models.Model): | |
name = models.CharField(max_length=200) | |
def __unicode__(self): | |
return self.name | |
class Post(models.Model): | |
title = models.TextField(max_length=200) | |
content = HTMLField() | |
excerpt = HTMLField() | |
above_fold = models.BooleanField(default=False) |
This file contains 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
def update_requirements(): | |
requirements = os.path.join(env.home, 'requirements') | |
with prefix('source %s/bin/activate' % env.python_path): | |
with cd(requirements): | |
cmd=['pip install'] | |
cmd += ['--requirement %s' % os.path.join(requirements, 'apps.txt')] | |
print(cmd) | |
run(' '.join(cmd)) |
OlderNewer