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
_getObjectAttr: function () { | |
var object = {}, | |
formValues = this.get("value"); | |
for (name in formValues) { | |
if (formValues.hasOwnProperty(name)) { | |
var nameParts = name.replace(/\]/g, '').split('['), | |
building = object; | |
dojo.forEach(nameParts, function (part, idx) { |
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
(function () { | |
// Static list across all Persons? | |
var pets = [ ]; | |
dojo.declare("Person", null, { | |
} | |
}()); |
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
fromString: function (dateString) { | |
if (!dateString) { return new Date(); } | |
// IE/Safari expects "2011/05/03 09:03:21-0500" | |
if (dojo.isIE || dojo.isSafari) { | |
// Replace hyphens with forward slashes (2011-05-03 => 2011/05/03) | |
dateString = dateString.replace(/^(\d{4})-(\d{2})-(\d{2})/, "$1/$2/$3"); | |
// Replace T prefixing time with a space (T09:03:21 => " 09:03:21") | |
dateString = dateString.replace(/T(\d+:\d+:\d+)/, " $1"); | |
// Remove colon in timezone (-05:00 => -0500) |
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
require 'java' | |
require 'jodconverter-cli-2.2.1.jar' | |
def convert(file_in,file_out) | |
inputFile = java.io.File.new(file_in) | |
outputFile = java.io.File.new(file_out) | |
# connect to an OpenOffice.org instance running on port 8100 | |
connection = com.artofsolving.jodconverter.openoffice.connection.SocketOpenOfficeConnection.new(8100) | |
connection.connect() |
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
require 'java' | |
require 'jodconverter-cli-2.2.1.jar' | |
def convert(file_in,file_out) | |
inputFile = java.io.File.new(file_in) | |
outputFile = java.io.File.new(file_out) | |
# connect to an OpenOffice.org instance running on port 8100 | |
connection = com.artofsolving.jodconverter.openoffice.connection.SocketOpenOfficeConnection.new(8100) | |
connection.connect() |
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
# ~/.tmux.conf | |
# | |
# See the following files: | |
# | |
# /opt/local/share/doc/tmux/t-williams.conf | |
# /opt/local/share/doc/tmux/screen-keys.conf | |
# /opt/local/share/doc/tmux/vim-keys.conf | |
# | |
# URLs to read: | |
# |
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
guard 'rails', :port => 3000, :server => :thin, :debugger => true do | |
watch('Gemfile.lock') | |
watch(%r{^(config|lib)/.*}) | |
# When caching classes, also restart when app is changed | |
cache_line = `cat config/environments/development.rb | grep "config\.cache_classes ="` | |
if cache_line =~ /=\s*(true|false)/ && $1 == 'true' | |
watch(%r{^app/.*}) | |
end | |
end |
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
# Install with: | |
# bash < <(curl -L https://raw.github.com/gist/1676687) | |
# | |
# Reference: http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug | |
echo "Installing ruby-debug with ruby-1.9.3-p0 ..." | |
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem | |
curl -OL http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem |
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
resize: -> | |
elem = @$() | |
usableHeight = elem.height() | |
elem.children(':not(.si-fill-container)').each (idx, childEl) -> | |
usableHeight -= $(childEl).outerHeight() | |
@$('.si-fill-container').css('height', "#{usableHeight}px") |
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
Person = Ember.Object.extend({ | |
pets: (function (key, val) { | |
if (arguments.length > 1) { | |
// set value | |
} | |
else { | |
// return value | |
} | |
}).property('_pets') | |
}); |