Skip to content

Instantly share code, notes, and snippets.

View jonmarkgo's full-sized avatar
🎓
preparing the MLH Fellowship

Jonathan Gottfried jonmarkgo

🎓
preparing the MLH Fellowship
View GitHub Profile
{
"listing": {
"created_at": "2011-03-09T17:28:40Z",
"description": "Awesome thinger for sale",
"id": 2,
"lat": 35,
"lng": 40,
"phone_number": null,
"photo_url": "http://example.com/photo.jpg",
"price": 10,
<?xml version="1.0" encoding="UTF-8"?>
<listing>
<created-at type="datetime">2011-03-10T03:38:15Z</created-at>
<description>Awesome thinger for sale</description>
<id type="integer">11</id>
<lat type="float">35.0</lat>
<lng type="float">40.0</lng>
<management-url>b309554196ab5e431</management-url>
<phone-number>+15558675309</phone-number>
<photo-url>http://example.com/photo.jpg</photo-url>
[{
"listing": {
"created_at": "2011-02-09T17:28:40Z",
"description": "Homemade Lemonade",
"id": 1,
"lat": 22.73,
"lng": -20.19,
"phone_number": null,
"photo_url": "http://example.com/photo.jpg",
"price": 100,
<?xml version="1.0" encoding="UTF-8"?>
<listing>
<created-at type="datetime">2011-03-09T17:28:40Z</created-at>
<description>Awesome thinger for sale</description>
<id type="integer">2</id>
<lat type="float">35.0</lat>
<lng type="float">40.0</lng>
<photo-url>http://example.com/photo.jpg</photo-url>
<price type="integer">10</price>
<status nil="true" />
{
"listing": {
"created_at": "2011-03-10T03:38:15Z",
"description": "Awesome thinger for sale",
"id": 11,
"lat": 35,
"lng": 40,
"management_url": "b309554196ab5e431",
"phone_number": "+15558675309",
"photo_url": "http://example.com/photo.jpg",
@jonmarkgo
jonmarkgo / gist:937364
Created April 22, 2011 18:52
Sphinx error
Started GET "/listings.json?description=a" for 10.203.10.109 at 2011-04-22 18:51:02 +0000
Processing by ListingsController#index as JSON
Parameters: {"description"=>"a"}
SQL (0.7ms) SHOW TABLES
Sphinx Query (74.6ms) *a*
Sphinx Found 0 results
Completed 200 OK in 86ms (Views: 1.9ms | ActiveRecord: 0.7ms | Sphinx: 74.6ms)
@jonmarkgo
jonmarkgo / gist:937367
Created April 22, 2011 18:54
Sphinx search
@listings = Listing.search params[:description],
:star => true,
:geo => [params[:lat].to_i,params[:lng].to_i],
:with => {
:page => params[:page].to_i,
:per_page => params[:per_page].to_i,
:price => params[:min_price].to_i..params[:max_price].to_i
}
$('div').live('pageshow', function(){
$('#changemeal a').live('tap',function(event){
$.cookie('ccm_CCMeal',$(this).text());
console.log($(this).text());
});
});
@jonmarkgo
jonmarkgo / gist:985066
Created May 22, 2011 01:10
PUT /players/id.json
{
"direction": 5,
"access_key": "5456481caaeb7b24fcb2ab920c8acd12ccd9fd0a719bcf468540a78b8bd55d13",
"password": "xyz345",
"email": "x@y.com"
}
@jonmarkgo
jonmarkgo / gist:985073
Created May 22, 2011 01:14
Delete player
{
"access_key": "5456481caaeb7b24fcb2ab920c8acd12ccd9fd0a719bcf468540a78b8bd55d13"
}