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
<script src="https://cdn.firebase.com/v0/firebase.js"></script> | |
<script type='text/javascript' src="https://cdn.firebase.com/v0/firebase-token-generator.js"></script> | |
var tokenGenerator = new FirebaseTokenGenerator("x"); | |
var token = tokenGenerator.createToken({isModerator: true}); | |
var dataRef = new Firebase("https://x.firebaseio.com/"); | |
dataRef.auth(token, function(error) { | |
if(error) { |
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 | |
//used for defined array, used on functions | |
class RECORD { | |
public $date_rec; | |
public $sessionID; | |
public $event_name; | |
public $app_version; | |
public $app_platform; | |
public $device; |
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 | |
//http://blog.parse.com/2013/03/19/implementing-scalable-search-on-a-nosql-backend/ | |
//10/4/2014-https://parse.com/questions/query-for-analytics-event-data | |
//10/6/2014 even writes that supports event queries - tested and no working! | |
//https://www.parse.com/docs/rest#analytics-custom | |
$headers = array( "X-Parse-Application-Id: x" , "X-Parse-REST-API-Key: y", "Content-Type: application/json"); |
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
//verified is the same as OpenSSL | |
public void btnSIGN_Click(View v) { | |
try { | |
packageInfo = getPackageManager().getPackageInfo("com.example.test2.test2.fb", PackageManager.GET_SIGNATURES); | |
for (Signature signature : packageInfo.signatures) { | |
MessageDigest md = MessageDigest.getInstance("SHA"); | |
md.update(signature.toByteArray()); | |
String key = new String(Base64.encode(md.digest(), 0)); | |
Toast.makeText(MainActivity.this, key + "\r\nsee LogCat", Toast.LENGTH_LONG).show(); |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" /> | |
<script type='text/javascript' src='jquery-1.10.2.min.js'></script> | |
<!-- firebase --> | |
<script type='text/javascript' src='https://cdn.firebase.com/v0/firebase.js'></script> | |
<script type='text/javascript' src='https://cdn.firebase.com/v0/firebase-simple-login.js'></script> |
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 | |
//ref : http://davidwalsh.name/backup-mysql-database-php | |
backup_tables('localhost','','','dbasename'); | |
/* backup the db OR just a table */ | |
function backup_tables($host,$user,$pass,$name,$tables = '*') | |
{ | |
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 | |
//ref : http://stackoverflow.com/questions/8710238/fetch-multiple-recordset-using-mysqli-object | |
//mysql | |
DELIMITER $$ | |
CREATE PROCEDURE `multiple`() | |
BEGIN | |
SELECT * FROM account; | |
SELECT * FROM admin; |
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
/* | |
WARNING CANT BE USED ON BULK OPERATIONS, USE OUT PARAMETER! | |
*/ | |
//procedure | |
DELIMITER $$ | |
CREATE PROCEDURE ADD_CAUSECOMPANY (IN fb_idVAR varchar(50)) | |
BEGIN |
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
//procedure | |
DELIMITER $$ | |
CREATE PROCEDURE ADD_CAUSECOMPANY (IN fb_idVAR varchar(50), OUT resVAL INT) | |
BEGIN | |
DECLARE x INT; | |
select id into x from fb_causescompanies where fb_id = fb_idVAR; | |
IF (x > 0 ) THEN |
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
//index.html (jQuery) | |
$.ajax({ | |
type : "POST", | |
url : "getResults.php", | |
data : "ID=" + "160", | |
datatype : "json", | |
success : function(result) { | |
console.log(result); | |
}, | |
error : function(msg) { |