Skip to content

Instantly share code, notes, and snippets.

View ndastur's full-sized avatar

Neville Dastur ndastur

  • Clinical Software Solutions
View GitHub Profile
@ndastur
ndastur / buildModForMe.bash
Created January 18, 2013 21:33
I got fed up of the fact that once I released a module into the Appcelerator marketplace I could not use it myself without getting Un-licensed module errors. So this script, modified the GUID and re-builds the module, then installs to the SDK location. Note that in more recent installs the SDK is located in home. Just change the line at 37,38 an…
#!/bin/bash
# make a backup file with the module GUID
# just in case there is some funny script error
# it will be available here
if [ ! -e "./moduleGUID_Backup.txt" ]
then
grep -i guid manifest > ./moduleGUID_Backup.txt
fi
/*
* V4L2 video capture example
*
* This program can be used and distributed without restrictions.
*
* This program is provided with the V4L2 API
* see http://linuxtv.org/docs.php for more information
*/
#include <stdio.h>
@ndastur
ndastur / gist:5420989
Last active December 16, 2015 10:38
Build offline docs for Titanium Appcelerator on Mac OSX
#! /bin/sh
#
# This file is based on https://gist.github.com/eric-hu/4952258
# which runs on linux
#
# Run this from the folder you want to be the parent of your docs
# By default, generated docs go into
# titanium_mobile/dist/apidoc/ti_mobile_docs/
#
# This can be changed below
@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' ) {
// add all items to collection
Alloy.Collections.Fugitive.reset([{
"name" : "Jeff Haynie"
}, {
"name" : "Nolan Wright"
}, {
"name" : "Don Thorp"
}, {
"name" : "Marshall Culpepper"
}, {
/*
The MIT License
Copyright (c) 2010 Roger Chapman
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@ndastur
ndastur / Generate alloy controller and add to git
Created August 26, 2013 18:53
Add this function to your .profile file to ease making alloy controllers and adding to git
function alloy_generate_ctrl {
alloy generate controller $1 && git add app/controllers/$1.js && git add app/views/$1.xml && git add app/styles/$1.tss
}
@ndastur
ndastur / LegacyAppceleratorCLIAlias.md
Last active August 29, 2015 14:01
Better alias for defining the Legacy Appcelerator CLI

Instructions in the Appcelerator Legacy CLI docs suggest setting up aliases. But these require manual adjustment when new versions are installed. This automacitally links to the latest legacy CLI.

LATEST_TI=$(ls -1 $HOME/Library/Application\ Support/Titanium/mobilesdk/osx/ | sort -r | head -1)
alias titanium.py="$HOME/Library/Application\ Support/Titanium/mobilesdk/osx/$LATEST_TI/titanium.py"
alias ios_builder="$HOME/Library/Application\ Support/Titanium/mobilesdk/osx/$LATEST_TI/iphone/builder.py"
@ndastur
ndastur / log.js
Last active March 26, 2018 14:42
Server and Client side logging in Meteor using Winston
/*
Add package:
meteor add votercircle:winston
Then use in server or client code as
logger.[debug|info|warn|error]
*/
if(Meteor.isServer) {
//- Ref: https://atmospherejs.com/votercircle/winston
//- Setup Winston logging
@ndastur
ndastur / README.md
Created March 9, 2017 14:53 — forked from jimothyGator/README.md
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/