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
//main_activity_super.xml | |
<menu xmlns:android="http://schemas.android.com/apk/res/android" > | |
<item android:id="@+id/logout" | |
android:title="logout" | |
android:showAsAction="never"/> | |
<item android:id="@+id/refresh" | |
android:title="refresh" | |
android:showAsAction="never"/> | |
<!-- http://stackoverflow.com/questions/8312344/how-to-add-a-dropdown-item-on-the-action-bar --> |
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
//the use | |
public void btnAdd_Click(View v) { | |
ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); | |
nameValuePairs.add(new BasicNameValuePair("mailto", "test@test.com")); | |
nameValuePairs.add(new BasicNameValuePair("subject", "test")); | |
CustomHttpTask poster = new CustomHttpTask(); | |
poster.setHTTP_Method(CustomHttpTask.httpMethod.POST); | |
poster.setNameValuePairs(nameValuePairs); |
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
//call | |
string srcString = ""; | |
if (comboBox1.SelectedIndex == 0) | |
srcString = "field-artist=" + txtArtist.Text.Substring(0, pos) + "&field-title=" + txtAlbum.Text.Substring(pos + 1); | |
WebREQ dbase = new WebREQ(@"http://www.amaxon.com/gp/search?search-alias=popular&" + srcString + "&sort=relevancerank"); | |
dbase.downloadSTR += new WebREQ.URL(dbase_downloadSTR); | |
dbase.get(); | |
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
//use | |
var record = {}; | |
record['testfield1'] = "test1"; | |
record['testfield2'] = "test2"; | |
record['testfield3'] = "test3"; | |
var preserveNodes = ['ccategories', 'stats', 'competitions', 'causes', 'companies']; | |
updateNode('https://' + baseURL + '/testcat/' + $('#oTESTCAT_updateID').val(), record, preserveNodes, null) |
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
//references : | |
//Firebase Custom Login - https://www.firebase.com/docs/security/custom-login.html | |
//Firebase REST API - https://www.firebase.com/docs/rest-api.html | |
// | |
//Firebase Token Generator for PHP - https://github.com/firebase/firebase-token-generator-php | |
//Encode and decode JSON Web Tokens (JWT) in PHP - https://github.com/firebase/php-jwt | |
//Firebase PHP Helper Library - https://github.com/ktamas77/firebase-php | |
*1* | |
//upload to server FirebaseToken.php + JWT.php + firebaseLib.php + |
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 | |
//$data sample | |
//"Apr 14 2018 02:38 AM",10,test,,1.00,Android,Apple,95,{ jsonTest : jsonTitle} | |
class StatsRecord { | |
public $date; | |
public $event_name; | |
public $app_version; | |
public $app_platform; |
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
//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 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 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 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 = '*') | |
{ | |
OlderNewer