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
(function() { | |
"use strict"; | |
angular.module("editableModule", ['ng']).directive("editable", function($timeout) { | |
return { | |
restrict: "AE", | |
scope: true, | |
require:"ngModel", | |
link: function(scope, element, attrs, ngModel) { | |
element.editable({ |
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
function findZoomRegion(points) { | |
var nbPtToShow = points.length-1; | |
var tmpDeltatLat = 0, tmpDeltatLong = 0, maxDeltatLat = 0, maxDeltatLong = 0, centerLat = 0, centerLong = 0; | |
for(var i = 0; i <= Math.floor(points.length / 2); i++) { | |
for(var j = nbPtToShow; j >= Math.floor(points.length / 2); j--) { | |
if(j != i) { | |
tmpDeltatLat = Math.abs(Math.abs(points[i].latitude) - Math.abs(points[j].latitude)); | |
if(tmpDeltatLat > maxDeltatLat) { | |
maxDeltatLat = tmpDeltatLat; |
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
/m/register | |
curl --include \ | |
--request POST \ | |
"http://realrider.swanify.com/m/register" \ | |
-d "forename=Matthew" \ | |
-d "surname=Lanham" \ | |
-d "[email protected]" \ | |
-d "dob=12/12/1985" \ | |
-d "password=password" \ |
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
// Put this in app.js | |
Ti.Facebook.appid = 'xxxxxxxxxxxxx'; | |
// Add a login button somewhere and put the following code inside it | |
Parse.FacebookUtils.init({}); | |
Parse.FacebookUtils.logIn(['publish_stream', 'email', 'read_friendlists', 'publish_actions'], { | |
success: function(user) { |
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
######### account.php in /models | |
<?php | |
class Account extends Eloquent { | |
public function user() | |
{ | |
return $this->belongs_to('User'); | |
} |
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(Fuel\Core\Request_Curl)#10 (10) { | |
["preserve_resource":protected]=> | |
NULL | |
["resource":protected]=> | |
string(40) "http://platform2/generic/index.json?id=1" | |
["params":protected]=> | |
array(0) { | |
} | |
["default_params":protected]=> | |
array(0) { |
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
<?php | |
namespace Orm; | |
class Observer_Accountid extends Observer | |
{ | |
/** | |
* @var string property to set the timestamp on | |
*/ | |
public static $property = 'account_id'; |
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
// No point applying an account id, unless we can tell the URL (this wont work for everything) | |
if(array_key_exists('SERVER_NAME', $_SERVER)) | |
{ | |
// Get the table name | |
$table_name = call_user_func($this->model.'::table'); | |
// Load config | |
$locked_tables = \Config::get('settings.protected_models'); | |
// Check if it's a protected modal |
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
javascript:$('#mw-sopaOverlay').remove();$('#content, #mw-head,#mw-panel').css('display','block');void(0); |
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
var port = 12345; | |
var serverUrl = "http://pushapi.eval.blackberry.com"; | |
var appId = "XXXXX"; | |
var max = 100; | |
var wakeUpPage = "push.htm"; | |
function openBISPushListener() { | |
try { | |
var ops = {port : port, appId : appId, serverUrl : serverUrl, wakeUpPage : 'push.htm', maxQueueCap : max}; |
NewerOlder