Skip to content

Instantly share code, notes, and snippets.

View deckameron's full-sized avatar

Douglas Alves deckameron

View GitHub Profile
// I was unhappy about there was close to no control over the "pageControl"
// in scrollableViews, so I hacked my own
// -----
// Configuration
function PagingControl(scrollableView){
var pages = [];
var page;
var numberOfPages = 0;
@deckameron
deckameron / Titanium Social
Last active August 29, 2015 14:01
This is code I found on the Web. It solves all the Social Sharing problems with Titanium
/**
* 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 THINGLINK;
/*
Enviar apenas o "src" adicionando "https:"
'<img style="max-width:100%" src="//cdn.thinglink.me/api/image/1038487784584642562/1024/10/scaletowidth#tl-1038487784584642562;" class="alwaysThinglink"/><script async charset="utf-8" src="//cdn.thinglink.me/jse/embed.js"></script>'
*/
var Dailymotion;
/*
Exemplo
exports.MaskInteger = function(v){
return v.replace(/\D/g,"");
};
/*Função que padroniza telefone (11) 94184-1241*/
exports.MaskTelephone = function(v){
v=v.replace(/\D/g,"");
v=v.replace(/^(\d{2})(\d)/g,"($1) $2");
v=v.replace(/(\d)(\d{4})$/,"$1-$2");
return v;
@deckameron
deckameron / RHelper.java
Created February 27, 2019 13:35
RHelper
import org.appcelerator.titanium.util.TiRHelper;
import android.content.Context;
import java.lang.reflect.Field;
import org.appcelerator.titanium.util.TiRHelper.ResourceNotFoundException;
import org.appcelerator.kroll.common.Log;
public class RHelper {
public static int getString(String str) {
try {
return TiRHelper.getApplicationResource("string." + str);
@deckameron
deckameron / uninstall_titanium.txt
Created March 26, 2020 20:33
How to completely uninstall Appcelerator Titanium on Mac
rm -rf ~/.appcelerator
rm -rf ~/.titanium
sudo npm uninstall -g titanium
sudo npm uninstall -g alloy
sudo npm uninstall -g acs
sudo npm uninstall -g appcelerator
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.node.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*