This file contains 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
respond_to do |format| | |
if @comment.save! | |
format.json do | |
... | |
end | |
format.html do | |
... | |
end | |
else | |
format.json do |
This file contains 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
def create | |
respond_to do |format| | |
format.json do | |
if @my_model.save! | |
render :json => @my_model.to_json(:methods => [:owner_name]) #owner_name is a method that returns owner.display_name | |
end | |
end | |
format html do | |
if @my_model.save! | |
... |
This file contains 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
When 'I create a new comment' do | |
steps %Q{ | |
When I enter comment text | |
And I press "Add Comment" | |
} | |
end | |
When 'I enter comment text' do | |
@comment = Factory :comment, :section => @section, :user => @me |
This file contains 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
nnoremap <C-W>O :call MaximizeToggle ()<CR> | |
nnoremap <C-W>o :call MaximizeToggle ()<CR> | |
nnoremap <C-W><C-O> :call MaximizeToggle ()<CR> | |
function! MaximizeToggle() | |
if exists("s:maximize_session") | |
exec "source " . s:maximize_session | |
call delete(s:maximize_session) | |
unlet s:maximize_session | |
let &hidden=s:maximize_hidden_save |
This file contains 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
--- | |
author: lmarburger | |
layout: post | |
--- | |
As you may be aware, we had quite a day at CloudApp yesterday. An individual | |
named Dustin Curtis took it upon himself to make a simple web page he called | |
[CloudApp Roulette]. The premise is simple: pick a random public URL and display | |
the image stored there. |
This file contains 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
newSelectedItems.filter(function (e:*, i:int, a:Array) : Boolean { | |
return a.indexOf(e,i + 1) == -1; | |
}; |
This file contains 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
// Letting Flex generate PropertyChangeEvents for you | |
// (most codegen by Flex, most inefficient, easiset to implement. | |
[Bindable] | |
public var field1 : String; | |
// You do everything. You don't necessarily need to fire a PropertyChangeEvent | |
// to trigger proper binding, as long as the event name == the name specified | |
// in the metadata. | |
// | |
// Note that [fieldname]Change is the Flex default, which means if you specify: |
This file contains 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
package flexUnitTests { | |
import flash.events.Event; | |
import flash.events.EventDispatcher; | |
import flash.events.IEventDispatcher; | |
import flash.utils.setTimeout; | |
import flexunit.framework.Assert; | |
import mx.core.mx_internal; | |
import mx.rpc.AsyncToken; |
This file contains 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
private function handleItemDoubleClick(event:ListEvent):void | |
{ | |
var dg:DataGrid = DataGrid(event.target); | |
dg.editable = true; | |
dg.editedItemPosition = event; // { rowIndex: event.rowIndex, columnIndex: event.columnIndex }; | |
} | |
private function handleItemEditEnd(event:DataGridEvent):void | |
{ | |
var dg:DataGrid = DataGrid(event.target); |
This file contains 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
#!/bin/bash | |
if [ "$#" -lt 3 ] | |
then | |
echo "Usage: $0 <filepattern> <searchterm> <replaceterm>" | |
echo "where <filepattern> is pattern of file to be scanned" | |
echo " <searchterm> is the pattern of the string to be found" | |
echo " <replaceterm> is the string that will replace <searchterm>" | |
exit 1 | |
fi |