Skip to content

Instantly share code, notes, and snippets.

@tabrindle
tabrindle / Sencha build for Xcode
Created September 12, 2013 13:12
Sencha build script for 'build phases' inside Xcode - Includes MD5 comparison
OLDMD5=`cat $PROJECT_DIR/www/project.md5`
NEWMD5=`ls -altR $PROJECT_DIR/www/app/ | grep -viw ".DS_Store" > $PROJECT_DIR/www/md5Helper.txt && md5 $PROJECT_DIR/www/md5Helper.txt | awk '{print $4}'`;
SENCHA_CMD="/Users/${USER}/bin/Sencha/Cmd/3.1.2.342"
echo "Old MD5 - $OLDMD5"
echo "New MD5 - $NEWMD5"
if [ "$OLDMD5" = "$NEWMD5" ]
then
echo "MD5s are the same. NOT Running Sencha Build."
@tabrindle
tabrindle / gist:6537256
Created September 12, 2013 13:25
Configure Sencha CMD to use a proxy.
Edit this file:
~/bin/Sencha/Cmd/3.1.2.342/sencha.cfg
Change line 33 to look like this:
cmd.jvm.args=-Xms128m -Xmx1024m -Djava.awt.headless=true -Dhttp.proxyHost=proxy.proxy.com -Dhttp.proxyPort=80​
@tabrindle
tabrindle / gist:6537307
Created September 12, 2013 13:28
Sencha itemTpl examples
itemTpl:[
"<div>",
"<div style='font-weight:bold;' class='list-item-title'>{FIRST_NAME} {LAST_NAME} </div>",
"<div class='list-item-narrative'>{EMAIL}</div>",
"<div class='list-item-narrative'>{PHONE}</div>",
"<div style='font-style:italic;' class='list-item-narrative'>",
"<tpl if='ACTIVE == 1'>",
"Active: True",
"</tpl>",
"</div>",
@tabrindle
tabrindle / gist:6537316
Last active December 22, 2015 21:59
Pause scrolling on listener in Sencha
listeners: {
dragstart: {
fn: function () {
y = this.parent.getScrollable().getScroller().position.y
this.parent.setScrollable({
direction: 'false',
initialOffset: {
x: 0,
y: y
}
@tabrindle
tabrindle / gist:6537364
Created September 12, 2013 13:31
chrome minus security
open -a Google\ Chrome --args --disable-web-security
@tabrindle
tabrindle / gist:6537381
Created September 12, 2013 13:32
Homebrew/weinre for MacOSx
Weinre
​Weinre is a debugger for web pages like Web Inspector, except it’s designed to work remotely, and in particular, to allow you debug web pages on a mobile device such as a phone.​
This includes the capability to see live debug from devices or the iOS simulator.
This could be used to see live debug from devices in the field.
​How to Install on MacOSX
Install Homebrew
​ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
install node.js
#! /usr/bin/python
# Author: Trevor A Brindle
# Copyright: Trevor A Brindle (2012), licensed under the GPL v 3.0
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
#! /usr/bin/python
# Author: Trevor A Brindle
# Copyright: Trevor A Brindle (2012), licensed under the GPL v 3.0
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
@tabrindle
tabrindle / D3Container.js
Created September 12, 2013 13:42
D3 compatibility file for Sencha
Ext.define('Ext.ux.D3Container', {
alias: 'plugin.D3Container',
constructor: function(config) {
this.initConfig(config);
},
init: function(parent) {
@tabrindle
tabrindle / lzwCompression.js
Created September 12, 2013 13:44
two functions for lzw encoding and decoding.
lzw_encode: function(s) {
var dict = {};
var data = (s + '').split('');
var out = [];
var currChar;
var phrase = data[0];
var code = 256;
for (var i=1; i < data.length; i++) {
currChar=data[i];
if (dict[phrase + currChar] != null) {