Snippets: Coldfusion Mask Output with *

June 27, 2007 @ 10:57 AM | posted by carmelyne

(last updated: 06.27.07)

Peekabooo. Oooops wha? I don't see you.

1
2
3
<cfoutput>
#repeatString("*",len(qPayment.CreditCardNumber))#
</cfoutput>

Snippets: Coldfusion Abort

June 26, 2007 @ 06:01 AM | posted by carmelyne

(last updated: 06.26.07)

Halt who goes there!

1
2
3
4
<cfif CGI.REMOTE_HOST IS NOT "127.0.0.1" 
  AND CGI.REMOTE_HOST IS NOT "192.168.0.1">
  <cfabort>
</cfif>

Collection of comment styles.

June 03, 2007 @ 07:36 AM | posted by carmelyne

(last updated: 08.08.07)

Single line comments:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
AppleScript (*Hello I am a comment*) 
ASP <% 'Hello I am a comment. %>
Bash # Hello I am a comment 
C // Hello I am a comment
C++ /* Hello I am a comment */
CSS /*  Hello I am a comment */
Coldfusion <!--- Hello I am a comment --->
DOS :: Hello I am a comment 
Erlang % Hello I am a comment 
HTML <!-- Hello I am a comment -->
Java // Hello I am a comment 
JavaScript  /* Hello I am a comment */ 
Liquid {% comment %} Hello I am a comment {% endcomment %} 
Lua -- Hello I am a comment --
Perl # Hello I am a comment  
PHP <?php // Hello I am a comment ?>
Python # Hello I am a comment  
Regex (?#Hello I am a comment)
Rails <%# Hello I am a comment %>
Ruby # Hello I am a comment 
Smarty {* Hello I am a comment *}
XML <!-- Hello I am a comment -->
YAML # Hello I am a comment  

I've been wondering what comment style is used in Liquid.

Got any to share?

Snippets of 06/24/07

Rails 'A'..'Z' Paginate

1
2
3
4
5
6
7
8
9
10
11
# Starts with 'A'..'Z' Paginate / model
def self.sort(sort)
  if sort
    find(:all, :conditions => ['name LIKE ?', "#{sort}%"])
  else
    find(:all, :order => 'name')
  end  
end

# index action / controller
@models = Model.sort(params[:sort]) 
RailsConf 2006
I heart devChix