Skip to content

Instantly share code, notes, and snippets.

require_relative 'account.rb'
def acc_to_ascii_table()
# first line
# 5.times do
# print " "
# 7.times{print "_"}
# end
# puts "\n"
puts "\n"
@PrasannaKumarChalla
PrasannaKumarChalla / RSVerticallyCenteredTextFieldCell.swift
Created August 27, 2017 18:08
vertically align nstextfield text
class RSVerticallyCenteredTextFieldCell: NSTextFieldCell {
var mIsEditingOrSelecting:Bool = false
override func drawingRect(forBounds theRect: NSRect) -> NSRect {
//Get the parent's idea of where we should draw
var newRect:NSRect = super.drawingRect(forBounds: theRect)
// When the text field is being edited or selected, we have to turn off the magic because it screws up
// the configuration of the field editor. We sneak around this by intercepting selectWithFrame and editWithFrame and sneaking a
// reduced, centered rect in at the last minute.