Oct 16 2010
- 04/10/2011 - Updated application.js and application.rb thanks to @rebo's comments
In this article, I will walk through some simple steps to get a [demo app][2] up and running with [Backbone.js][3] and [Sinatra][4] on [Heroku][5].
private String createShopSearchQuery() throws NoSuchAlgorithmException, InvalidKeyException, UnsupportedEncodingException { | |
String jsonAction = "http://api.ravelry.com/shops/search.json?"; | |
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss.SSSZ"); | |
Calendar now = Calendar.getInstance(); | |
String timestamp = df.format(now.getTime()); | |
String searchTerm = "yarn"; | |
int shop_type_id = 1; | |
String query = jsonAction; | |
query += "access_key=" + urlEncode(ACCESS_KEY); |
module Jekyll | |
class CategoryIndex < Page | |
def initialize(site, base, dir, category) | |
@site = site | |
@base = base | |
@dir = dir | |
@name = 'index.html' | |
self.process(@name) | |
self.read_yaml(File.join(base, '_layouts'), 'category_index.html') |
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
App.AccountEditRoute = Ember.Route.extend({ | |
setupController: function(controller) { | |
controller.set('content', this.get('currentUser')); | |
} | |
}); |
import com.google.gson.Gson; | |
import com.google.gson.JsonSyntaxException; | |
import com.android.volley.AuthFailureError; | |
import com.android.volley.NetworkResponse; | |
import com.android.volley.ParseError; | |
import com.android.volley.Request; | |
import com.android.volley.Response; | |
import com.android.volley.Response.ErrorListener; | |
import com.android.volley.Response.Listener; |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Bash Command Visualization</title> | |
<style type="text/css"> | |
* { margin: 0; padding: 0; } | |
#chart { |
<?php | |
class Example_controller extends CI_Controller { | |
// … | |
// Others attributes and methods omitted for brevity | |
/* | |
* Unfortunatelly, CodeIgniter does not work well with Stored Procedure with returning parameters, | |
* so, if you want to use any kind of Stored Procedure with parameters, it's better do it mannualy. |