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
// | |
// ViewController.swift | |
// Find Your Hood | |
// | |
// Created by Mark Abeles | |
// Copyright (c) 2016 Mabeles. All rights reserved. | |
// | |
import UIKit | |
import CoreLocation |
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
class Demo1 | |
def initialize a:, b: | |
@a = a | |
@b = b | |
puts "@a = #{@a.inspect} and @b = #{@b.inspect}" | |
end | |
end | |
Demo1.new a: 'one', b: 'two' | |
# ==> @a = nil and @b = "two" |
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
# Not a very elegant solution. I'd love to build something along these lines but more automated into crypt_keeper when I have more time. | |
module EncryptionHelper | |
def self.mysql_decrypted_field(field_name, options = {}) | |
options[:as] = "#{field_name.gsub('.','_')}_decrypted" unless options[:as] == false | |
decrypt_query = "AES_DECRYPT(from_base64(#{field_name}), '#{MyApp::Application.config.crypt_passphrase}')" | |
decrypt_query << " AS #{options[:as]}" unless options[:as] == false | |
decrypt_query |