Skip to content

Instantly share code, notes, and snippets.

View csemrm's full-sized avatar

Mostafizur Rahman csemrm

View GitHub Profile
<?php
// Put your device token here (without spaces):
$deviceToken = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
// Put your private key's passphrase here:
$passphrase = 'xxxxxxx';
// Put your alert message here:
$message = 'A push notification has been sent!';
@csemrm
csemrm / app.js
Created December 28, 2014 09:20 — forked from rakhimoni/app.js
var win = Titanium.UI.createWindow({
backgroundColor : 'red',
});
// get refernce to the current window
var queslabel = Titanium.UI.createLabel({
text : 'Question',
height : 50,
color : '#000000',
font : {
/*
Copyright 2011-2013 Abdulla Abdurakhmanov
Original sources are available at https://code.google.com/p/x2js/
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
This gist is only for Android.
If you would like launch native apps
on iPhone, iPad, you can find information about it in Appcelerator Docs:
-https://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Platform.canOpenURL-method.html
-https://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Platform.openURL-method.html
More info about iOS URL Schemes: http://handleopenurl.com/
fs.exists('data/ipg150303.xml', function (exists) {
console.log("exists" + exists);
if (exists) {
console.log("exists" + exists);
fs.readFile('data/ipg150303.xml', 'utf8', function (err, data) {
if (err) {
return console.log(err);
}
data = data.split('<?xml version="1.0" encoding="UTF-8"?>');
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE us-patent-grant SYSTEM "us-patent-grant-v45-2014-04-03.dtd" [ ]>
<us-patent-grant lang="EN" dtd-version="v4.5 2014-04-03" file="USD0723366-20150303.XML" status="PRODUCTION" id="us-patent-grant" country="US" date-produced="20150217" date-publ="20150303">
<us-bibliographic-data-grant>
<publication-reference>
<document-id>
<country>US</country>
<doc-number>D0723366</doc-number>
<kind>S1</kind>
<date>20150303</date>
@csemrm
csemrm / social.js
Last active August 29, 2015 14:27 — forked from myleftboot/social.js
An implementation of social.js for Appcelerator Titanium. Works with Twitter v1.1 effective from 5th March 2013
/**
* This is a JavaScript module for Titanium Mobile made by Dawson Toth. I adapted the majority of this code from other
* authors to make it easy to share content on social sites through a single interface.
*
* Example usage: http://appc.me/social.sample.js
*
*/
//
var win = Titanium.UI.createWindow({
title : 'Audio Test',
backgroundColor : '#fff',
//layout : 'vertical'
});
var url = encodeURIComponent("https://itunes.apple.com/us/app/smartuaq/id1063110068?ls=1&mt=8").replace(/'/g,"%27").replace(/"/g,"%22");
var whatsappUrl = 'whatsapp://send?text=' + url;
@csemrm
csemrm / app.js
Created March 18, 2016 07:00
Login with TouchId in Appcelerator
var TiTouchId = require("ti.touchid");
var win = Ti.UI.createWindow();
var btn = Ti.UI.createButton({
title : 'authenticate'
});
win.add(btn);
var retry = 0;
btn.addEventListener('click', function() {
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Light" parent="Theme.AppCompat.Light"/>
<style name="Dark" parent="Theme.AppCompat"/>
<style name="Theme.CustomActionBar" parent="@style/Theme.AppCompat.Light">
<!-- Specify an Action Bar style to use -->
</style>
</resources>