This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| str = "Hello, Ruby" | |
| idx = str.index("Ruby") | |
| puts "Index of 'Ruby' is : #{idx}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| puts "Hello world" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Ext.define 'ListHeaderFooter.view.Main' | |
| extend:'Ext.tab.Panel' | |
| xtype:'main' | |
| requires:[ | |
| 'Ext.TitleBar' | |
| 'Ext.dataview.List' | |
| ] | |
| config: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <input type="hidden" name="select_image" class="asset_required" value="1" /> | |
| <input type="hidden" name="upload_image" class="asset_required" value="0" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <input type="hidden" name="select_image_required" class="asset_required" value="1" /> | |
| <input type="hidden" name="upload_image_required" class="asset_required" value="0" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!--- get a list of videos that need embeddeding ---> | |
| <cfparam name="range" default="1" /> | |
| <cfparam name="relativePath" default="/_SITEID_/assets/Image/video-thumbs/" /> | |
| <cfparam name="saveDirectory" default="#expandPath(relativePath)#" /> | |
| <cfparam name="siteID" default="_SITEID_" /> | |
| <cfscript> | |
| // create the save directory if it doesn't exist | |
| if (!directoryExists(saveDirectory)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <cfscript> | |
| colourArray = ["Red","Orange","Yellow","Green","Blue","Indigo","Violet"]; | |
| colourArrayTwo = ["Yellow","Green","Red","Violet"]; | |
| // duplicate one array as the result of retainAll remove the elements no present in both | |
| // we want to keep the original array and return a new array | |
| presentInBoth = duplicate(colourArray); | |
| presentInBoth.retainAll(colourArrayTwo); | |
| writeDump(presentInBoth); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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++) { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Ext.define 'groupedlist.store.Stories' | |
| extend:'Ext.data.Store' | |
| config: | |
| model:'groupedlist.model.Story' | |
| autoLoad:false | |
| grouper: | |
| groupFn:(record)-> | |
| return record.get("section_name") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "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"}, |