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
object: | |
{ | |
"location": { | |
"coords": { | |
"latitude": [Float], | |
"longitude": [Float] | |
"accuracy": [Float] | |
"speed": [Float], | |
"heading": [Float], |
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
// Add custom longpress event for adding GeoFence with hard-coded radius 200m. | |
google.maps.event.addListener(app.map, 'longpress', function(e) { | |
if (app.geofence) { | |
app.geofence.setMap(null); | |
} | |
// Add the geofence with BackgroundGeolocation plugin | |
bgGeo.addGeofence({ | |
identifier: 'MyGeofence', | |
radius: 200, | |
latitude: e.latLng.lat(), |
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
module GeoKit | |
#It is half of the earth circumference in pixels at zoom level 21. | |
#You can visualize it by thinking of full map. Full map size is 536870912 × 536870912 pixels. | |
#Center of the map in pixel coordinates is 268435456,268435456 which in latitude and longitude would be 0,0. | |
PIXEL_OFFSET = 268435456 | |
PIXEL_RADIUS = PIXEL_OFFSET / Math::PI | |
module Mappable | |
module ClassMethods |
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
LanguageTranslation | |
has_many :dependencies, :after_remove => :on_remove_dependency | |
private | |
def on_remove_dependency(dep) | |
if dependencies.count == 0 | |
# if this phrase is no longer pointed-to, destroy self | |
self.destroy | |
end | |
end |
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
#!/bin/bash | |
if pushd platforms/ios 2>/dev/null ; then # iOS-specific actions... | |
# Patch *-Info.plist | |
PROJNAME=$(echo *.xcodeproj|sed -e 's/\..*//') | |
sed -i '' '/<key>NSMainNibFile<\/key>/,/<\/string>/d' $PROJNAME/*-Info.plist | |
sed -i '' '/<key>NSMainNibFile~ipad<\/key>/,/<\/string>/d' $PROJNAME/*-Info.plist | |
popd | |
fi |
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
#!/bin/bash | |
# License: Public Domain. | |
# Author: Joseph Wecker, 2012 | |
# | |
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile? | |
# Are you tired of trying to remember how darwin/mac-osx treat them differently from linux? | |
# Are you tired of not having your ~/.bash* stuff work the way you expect? | |
# | |
# Symlink all of the following to this file: | |
# * ~/.bashrc |
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
Ext.define('GridScaffold', { | |
extend: 'Ext.AbstractPlugin', | |
alias: 'plugin.grid.Scaffold', | |
enableDD: false, | |
constructor: function(config) { | |
var grid = config.cmp; | |
grid.items = grid.items || []; | |
if (config.enableDD) { | |
// construct a sub-plugin within another but have call #constructPlugin at this point. |
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
// @_jdg Ok, I think I see where you're going, you're saying you can't do this: | |
// | |
Ext.define('MyClass', { | |
extend: 'Ext.panel.Panel', | |
initComponent: function() { | |
Ext.apply(this, { | |
plugins: ['my-plugin'], | |
. | |
. |
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
/** | |
* AjaxProxy is totally borked when it comes to synchronizing records of an UPDATE or CRDATE action | |
* NB: This hack assumes that server will return result recordset in the same order received. | |
*/ | |
Ext.override(Ext.data.AjaxProxy, { | |
createRequestCallback: function(request, operation, callback, scope) { | |
var me = this; | |
return function(options, success, response) { | |
if (success === true) { | |
var reader = me.getReader(), |
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
// Your response uses XML-like nesting which is incompatible with Sencha's JsonReader. | |
[ | |
{ // <----- no | |
"category": { | |
. | |
. | |
. | |
"tracks": [ | |
{ // <------ no |