Skip to content

Instantly share code, notes, and snippets.

View shouse's full-sized avatar

Steven shouse

  • SIVCI
  • Kansas City, MO
View GitHub Profile
@FokkeZB
FokkeZB / VALIDATE.md
Last active December 16, 2015 22:39
Validation lib for Titanium
@dbankier
dbankier / alloy.jmk
Created May 25, 2013 12:45
alloy.jmk for automatic spy injection for TiShadow
task("pre:compile", function(event,logger) {
var wrench = require("wrench"),
fs = require("fs"),
controllers_root = event.dir.controllers,
path = require("path");
if (event.alloyConfig.deployType === 'production') {
return;
}
@ndastur
ndastur / events.js
Created June 4, 2013 14:36
Common JS module to help with handling Titanium Appcelerator events.
/*
* Common JS module to help with Ti Event listener handling.
* @author Neville Dastur
* @url http://www.clinsoftsolutions.com
*
* Acknowledgements go to https://gist.github.com/minhnc/2333095 as my starting point on this
*/
exports.registerEventListener = function(obj, event, callabck) {
if ( typeof obj._eventListeners == 'undefined' ) {
@tsteur
tsteur / alloy.jmk
Last active November 8, 2017 02:12
Simple build configuration file for Titanium Mobile Alloy to remove unimportant log calls if build type is production
function isProduction(alloyConfig)
{
return 'production' == alloyConfig.deploytype;
}
function removeUnimportantLogCallsFromContent(content)
{
if (!content) {
return;
}
@tonylukasavage
tonylukasavage / app.tss
Created July 16, 2013 14:49
TSS reset for Alloy/Titanium
'Label[platform=android]': {
color: '#000' // all platforms except Android default to black
}
'Window': {
backgroundColor: '#fff' // white background instead of default transparent
}
'Window[platform=android]': {
modal: false // make android windows all heavyweight
@FokkeZB
FokkeZB / DOWNSIZE.md
Last active December 8, 2016 10:39
Automatically generate non-retina and Android images for Alloy projects

UPDATE: With the assets command of the TiCons CLI / Module this can be done even simpeler by calling $ ticons assets or an alloy.ymk using:

task("pre:load", function(event, logger) {
    require('ticons').assets();
});

@aaronksaunders
aaronksaunders / app_snippet_1.js
Last active August 25, 2017 03:10
Utilizing the Queue Library from Async.js for downloading multiple assets with Appcelerator Titanium
//
// https://github.com/caolan/async
//
var async = require('async');
// this function will be called for each array element
function process(_url, _processCallback) {
// download the file
get_file(_url, function(_resp) {
@jpalumickas
jpalumickas / osascript.rb
Last active July 1, 2021 11:36
osaScript Ruby examples
# === Terminal.app === #
# Open new tab in terminal.
exec("osascript -e 'tell application \"System Events\" to tell process \"Terminal\" to keystroke \"t\" using command down' > /dev/null 2>&1 ")
# Open directory
exec("osascript -e 'tell application \"Terminal\" to do script \"cd directory\" in selected tab of the front window' > /dev/null 2>&1 ")
# Open directory in new tab (this is better)
exec("osascript -e 'tell application \"Terminal\"' -e 'tell application \"System Events\" to tell process \"Terminal\" to keystroke \"t\" using command down' -e 'do script with command \"cd directory && clear\" in selected tab of the front window' -e 'end tell' > /dev/null 2>&1")
@glejeune
glejeune / xml_parser.sh
Last active October 10, 2023 09:45
A simple XML parser for sh, zsh, bash, ...
#!/bin/sh
# This script is a very naive XML parser for sh
# ...
# This fontion is called once for each file. It initialize the parser
#
# Type: private
# Parameters:
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active May 4, 2026 20:38
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName