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
- (void)webViewDidFinishLoad:(UIWebView*)theWebView | |
{ | |
// Black base color for background matches the native apps | |
theWebView.backgroundColor = [UIColor blackColor]; | |
// ADD THIS LINE! | |
theWebView.scrollView.bounces = NO; | |
return [super webViewDidFinishLoad:theWebView]; | |
} |
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
NDK_PATH=/Users/elias/bin/android-ndk-r9c | |
BASE_TOOLCHAIN_DIR=/tmp/achain | |
ARCH=armeabi | |
HOST=x86_64-apple-darwing13.0.0 | |
TOOLCHAIN_DIR=/tmp/achain | |
SYSROOT=${TOOLCHAIN_DIR}/sysroot | |
TARGET="arm-linux-androideabi" | |
CFLAGS="-mthumb" |
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
CFLAGS="-mthumb" CXXFLAGS="-mthumb" ./configure --target=arm-linux-androideabi --with-android-ndk=/Users/elias/bin/android-ndk-r9c/ --with-android-toolchain=/tmp/achain/ --disable-shared-js --disable-debug --enable-optimize |
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
/* jshint node: true, laxcomma: true */ | |
/* global __dirname */ | |
/* Dependencies */ | |
var express = require("express") | |
, Q = require("q") | |
, check = require("validator").check | |
, auth = require("./simpleauth") | |
, MongoClient = require("mongodb").MongoClient |
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 AnimatedRegion = Base.Region.extend({ | |
show: function(view, dir) { | |
this.forward = !dir; // true or false | |
Base.Region.prototype.show.call(this, view); | |
}, | |
animationClass: "slide", | |
open: function(view) { | |
this.el = this.$el.get(0); | |
var from = this.currentView, | |
anim = this.animationClass, |
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
distance: function(coords) { | |
var barPos = this.get("location"), | |
R = 6371*1000, | |
dtr = Math.PI / 180, | |
lat1 = coords.latitude*dtr, lon1 = coords.longitude*dtr, | |
lat2 = barPos.latitude*dtr, lon2 = barPos.longitude*dtr, | |
x = (lon2-lon1) * Math.cos((lat1+lat2)/2), | |
y = (lat2-lat1), | |
d = Math.sqrt(x*x + y*y) * R; |
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
/* Router */ | |
var AppRouter = R.extend(SmartRouter, { | |
init: function() { | |
this._super() | |
this.hottest() | |
}, | |
routes: { | |
"": "index", | |
"latest": "latest", |
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
/* Collections */ | |
var PostCollection = R.extend(BaseCollection, { | |
model: Post, | |
/* DEBUG */ | |
fetch: function(options) { | |
var PostFactory = Solipsist.Factory({ | |
id: Solipsist.Factory.int_sequence(), | |
title: "Soy un post", | |
description: "Soy una descripción de un post", |
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
/* Base classes */ | |
var BaseView = R.extend(Backbone.View, { | |
init: function() { | |
return Backbone.View.apply(this, arguments) | |
}, | |
render: function() { | |
var model = (this.model || this.collection), | |
data = model.toJSON(), | |
html = this.template(data) |
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 Votable = { | |
mixed: function(klass) { | |
var events = { | |
"click .js-votes-plus": "plusVote", | |
"click .js-votes-minus": "minusVote", | |
}, | |
proto = klass.prototype | |
proto.events = _.extend({}, events, proto.events) | |
}, | |
plusVote: function(e) { |