Skip to content
View cfdiv-1.cfm
<cfdiv bind="url:/demo/cfdiv/files/getHTML.cfm?name={myForm2:name}&age={myForm2:age}"
bindOnLoad="false"
onBindError="onError"
id="mydiv1"/>
View cfc-bind-1.cfm
<cfajaxproxy bind="cfc:demo.cfajaxproxy.files.test.getName({myForm:myName})" onSuccess="updateDiv1" onError="onError"/>
<script type="text/javascript">
updateDiv1 = function(data, textStatus){
document.getElementById('myDiv1').innerHTML = data;
}
</script>
<form format="html" id="myForm">
<label>My Name</label><input type="text" name="myName">
</form>
<div id="myDiv1" class="result"> </div>
View views.md

Add prepended view paths

controller.prepend_view_path "app/views/{path_prepended}/"
View mysql.md

Restore db from dump

mysql -u {username} -h {host} -p {db} < dump.sql
View idioms.md

Self Yield

Person.new do |p|
  p.name = ...
end

Object pass self to the initiliaze method as block.

class Person
    def initialize
#!upstart
description "Workers [resque]"
start on (local-filesystems and net-device-up IFACE=eth0)
stop on shutdown
respawn
respawn limit 99 5
console none
-server -XX:MaxPermSize=128m -Xms2048m -Xmx2048m
-Dsun.rmi.dgc.client.gcInterval=3600000
-Dsun.rmi.dgc.server.gcInterval=3600000 -XX:+UseConcMarkSweepGC
-XX:+CMSClassUnloadingEnabled
View resque_util
Resque::Worker.all.each {|w| w.unregister_worker}
View ruby_comparable_sort.rb
[p2,p3,p1].sort #[#<Person:0x104f09d80 @name="Andrea">, #<Person:0x104f09d30 @name="Fabio">, #<Person:0x104f09ce0 @name="Luigi">]
View ruby_enumerable.rb
class PersonEnumerator
include Enumerable
attr_reader :persons
def initialize(persons)
@persons = persons
end
def each &block
@persons.each do |person|
Something went wrong with that request. Please try again.