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 point_in_polygon?(polygonPoints) | |
return false if self.latitude.blank? or self.longitude.blank? | |
polygonPoints.each do |point| | |
point[0] = point[0].to_f | |
point[1] = point[1].to_f | |
end | |
contains_point = false | |
i = -1 | |
j = polygonPoints.size - 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
$('[placeholder]').focus(function() { | |
var input = $(this); | |
if (input.val() == input.attr('placeholder')) { | |
if (this.originalType) { | |
this.type = this.originalType; | |
delete this.originalType; | |
} | |
input.val(''); | |
input.removeClass('placeholder'); | |
} |
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
$('#formId').submit(function() { | |
newValue = toCurrency($('#filed1Id').val()) | |
newValue2 = toCurrency($('#field2Id').val()) | |
return false; | |
}); |
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 'formula' | |
class Librets < Formula | |
url 'http://www.crt.realtors.org/projects/rets/librets/files/librets-1.5.2.tar.gz' | |
homepage 'http://code.crt.realtors.org/projects/librets' | |
md5 '74bcea0eb11f3c66cde5dc3ecea05224' | |
depends_on 'boost' | |
depends_on 'curl' | |
depends_on 'expat' |
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 toCurrency(num) { | |
var sign; | |
var cents; | |
var i; | |
num = num.toString().replace(/\$|\,/g, ''); | |
if (isNaN(num)) { | |
num = "0"; | |
} | |
sign = (num == (num = Math.abs(num))); |
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 -xe | |
EBS_DEVICE='/dev/sdh' | |
INSTANCE_ID=$1 | |
AKI=${2:-'aki-5f15f636'} | |
ARI=${3:-'ari-0915f660'} | |
ARCH=${4:-'i386'} | |
SIZE=${5:-10} | |
AZ=${6:-'us-east-1d'} | |
NAME=${7:-"ami-from-$INSTANCE_ID"} |
NewerOlder