This file contains hidden or 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
employee ? employee.full_name : 'None' | |
or this: | |
employee.try(:full_name).presence || 'None' |
This file contains hidden or 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 'matrix' | |
# Matrix enhance | |
class Matrix | |
def []=(i, j, x) | |
@rows[i][j] = x | |
end | |
end | |
# |
This file contains hidden or 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
grayImage.lockFocus() | |
var ciImage:CIImage = CIImage(data: image.TIFFRepresentation) | |
var monochromeFilter:CIFilter = CIFilter(name: "CIColorMonochrome") | |
monochromeFilter.setDefaults() | |
monochromeFilter.setValue(ciImage, forKey:kCIInputImageKey) | |
monochromeFilter.setValue(CIColor(red: 0, green: 0, blue: 0, alpha: 1), forKey:"inputColor") | |
monochromeFilter.setValue(NSNumber(float: 1), forKey:"inputIntensity") | |
var outputImage:CIImage = monochromeFilter.valueForKey(kCIOutputImageKey) as! CIImage | |
outputImage.drawAtPoint(NSPoint.zeroPoint, fromRect: NSRect(origin: NSPoint.zeroPoint, size: image.size), operation: NSCompositingOperation.CompositeCopy, fraction: 0.6) |
This file contains hidden or 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
# | |
# Database.yml | |
# | |
development_ios: | |
# <<: *default | |
adapter: sqlite3 | |
pool: 5 | |
timeout: 5000 | |
database: db/development_ios.sqlite3 |