Skip to content

Instantly share code, notes, and snippets.

@aaronksaunders
aaronksaunders / app.js
Created October 16, 2011 07:04
Handling click event in button/view on a row
var win = Ti.UI.createWindow({});
var tableView = Ti.UI.createTableView({});
for(var i = 0; i < 5; i++) {
var checkBox = Ti.UI.createView({
width : 20,
height : 20,
done : false,
item_type : "CHECKBOX", // us this to know we clicked a checkbox
@aaronksaunders
aaronksaunders / app_2.js
Created October 16, 2011 07:54
More Fun with TableView Rows
var win = Ti.UI.createWindow({});
var tableView = Ti.UI.createTableView({});
for(var i = 0; i < 5; i++) {
var checkBox = Ti.UI.createView({
width : 20,
height : 20,
done : false,
item_type : "CHECKBOX", // us this to know we clicked a checkbox
@aaronksaunders
aaronksaunders / helper.js
Created October 16, 2011 07:58
Simple function to find child objects
/**
* helper to find an element, can be used when there are
* multiple elements in a row and you need to find one
*
* @param _o {Object} parent object to find elements in
* @param _i {String} id of the element you are looking for
*/
function findElement(_o, _i) {
for(var x in _o.children) {
if(_o.children[x].id === _i) {
@aaronksaunders
aaronksaunders / helper2.js
Created October 16, 2011 08:15
Function to scan through table rows to determine which ones are selected
/**
* simple method to get the list of items selected
*/
function checkedRowsAre() {
// get the rows; there is a default section in all tables so that
// is why we need to get the rows this way
var selected = [];
var rows = tableView.data[0].rows;
// iterate through the rows to find out which ones are selected,
@iskugor
iskugor / app.js
Created February 2, 2012 13:12
How to get table view row object from row index in Titanium
var win = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff'
});
var aTableView = Ti.UI.createTableView();
var data = [
Ti.UI.createTableViewRow({title:'Row 1', hasChild:true, color:'red', header:'First'}),
Ti.UI.createTableViewRow({title:'Row 2', hasDetail:true, color:'green'}),
@raulriera
raulriera / DialogWindow.js
Created September 9, 2012 11:08
CustomAlertDialog commonJS module for Titanium Appcelerator. Similar to the "Tweetbot" (but will need more makeup of course) where the information is displayed below the title bar instead of an intrusive popup
DialogWindow = function(message, type){
// Default params
var message = message || "How about you add some message to this? :)";
var type = type || "error";
var window = Titanium.UI.createWindow({
width: 320,
height: 44,
top: 44,
@michele-tn
michele-tn / GetRUSTDESKLatestVersion_NIGHTLY.ps1
Created March 21, 2024 10:14
Downloads the latest version of Rustdesk (Nightly or Latest) using the GitHub API web service, configures application by setting the IP and keys of your self-hosted server. Finally, it runs the application you just downloaded. That's all. ;-)
<#
.AUTHOR : MICHELE-TN
.CLIENT DEPLOYMENT : https://rustdesk.com/docs/en/self-host/client-configuration/
: https://rustdesk.com/docs/en/self-host/client-deployment/
.SERVER DEPLOYMENT : https://rustdesk.com/docs/en/self-host/
.Techahold/rustdeskinstall : Easy install Script for Rustdesk
: https://github.com/techahold/rustdeskinstall
@michele-tn
michele-tn / SSH_PlinkConnecting.ps1
Last active May 10, 2024 12:18
(MULTIPLE TCP TUNNELING) Connecting and Loading SSH private keys automatically on plink
# Run as administrator and stays in the current directory
if (-Not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
if ([int](Get-CimInstance -Class Win32_OperatingSystem | Select-Object -ExpandProperty BuildNumber) -ge 6000) {
Start-Process PowerShell -Verb RunAs -ArgumentList "-NoProfile -ExecutionPolicy Bypass -Command `"cd '$pwd'; & '$PSCommandPath';`"";
}
}
[Net.ServicePointManager]::SecurityProtocol = "Tls, Tls11, Tls12, Ssl3"
# Convert from Base64 to EXE