Skip to content

Instantly share code, notes, and snippets.

@jbuda
jbuda / gist:5196181
Created March 19, 2013 13:41
ProgressBArManager.as
package com.progressbar.managers {
import flash.events.*;
[Bindable]
public class ProgressBarManager extends EventDispatcher {
@jbuda
jbuda / gist:5196188
Created March 19, 2013 13:42
ProgressBarEvent
package com.progressbar.events {
import flash.events.Event;
import mx.collections.ArrayCollection;
[Bindable]
public class ProgressBarEvent extends Event {
@jbuda
jbuda / gist:5196217
Created March 19, 2013 13:46
MangoBlog and Twitpic coldfusion
<cfset urlstring = 'http://twitpic.com/photos/jbuda' />
<cfhttp url="#urlstring#" method="get" />
<cfset rawUrl = toString(cfhttp.filecontent) />
<cfset pos = 1 />
<cfset imageArray = arrayNew(1) />
<cfset regexp = '>div class="profile-photo-img"<(.*?)>/div<' />
<cfset found = refindnocase(regexp,rawUrl,pos,true) />
<cfloop condition="pos lt len(rawUrl)">
<cfset found = refindnocase(regexp,rawUrl,pos,true) />
@jbuda
jbuda / gist:5201039
Created March 19, 2013 23:18
YouTube model for video
Ext.define 'youtube.model.Video'
extend:'Ext.data.Model'
config:
fields:[
{name:'title',type:'string'}
{name:'thumbnail',type:'string'}
{name:'href',type:'string'}
]
@jbuda
jbuda / gist:5201116
Last active December 15, 2015 04:19
YouTube API Controller Sencha touch
Ext.define 'youtube.controller.Videos'
extend:'Ext.app.Controller'
requires:[
'Ext.data.proxy.JsonP'
]
config:
refs:
videosList:'videoslist'
@jbuda
jbuda / gist:5201134
Created March 19, 2013 23:35
YouTube store sencha touch
Ext.define 'youtube.store.Videos'
extend:'Ext.data.Store'
config:
model:'youtube.model.Video'
@jbuda
jbuda / gist:5201192
Created March 19, 2013 23:45
YouTube list channel Sencha Touch
Ext.define 'youtube.videos.List'
extend:'Ext.List'
xtype:'videoslist'
config:
title:'Videos'
itemTpl:'<div class="clearfix"><img src="{thumbnail}" /><p>{title}</p></div>'
store:'Videos'
@jbuda
jbuda / gist:5262846
Created March 28, 2013 12:47
sample json for Sencha Group List
{
"stories":[
{"headline":"headline 1","section_name":"section_name 1"},
{"headline":"headline 2","section_name":"section_name 1"},
{"headline":"headline 1","section_name":"section_name 2"},
{"headline":"headline 1","section_name":"section_name 3"},
{"headline":"headline 2","section_name":"section_name 3"},
{"headline":"headline 2","section_name":"section_name 2"},
{"headline":"headline 3","section_name":"section_name 1"},
{"headline":"headline 4","section_name":"section_name 1"},
@jbuda
jbuda / gist:5262918
Created March 28, 2013 12:58
Grouped Sencha List to show only 2 items
Ext.define 'groupedlist.store.Stories'
extend:'Ext.data.Store'
config:
model:'groupedlist.model.Story'
autoLoad:false
grouper:
groupFn:(record)->
return record.get("section_name")
@jbuda
jbuda / gist:5336134
Last active December 15, 2015 22:50
ColdFusion block to output the intersection of two arrays
<cfscript>
colourArray = ["Red","Orange","Yellow","Green","Blue","Indigo","Violet"];
colourArrayTwo = ["Yellow","Green","Red","Violet"];
presentInBoth = [];
// loop initial array with values
for(i=1;i<=arrayLen(colourArray);i++) {
// loop over inner array
for(j=1;j<=arrayLen(colourArrayTwo);j++) {