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
// | |
// LaunchAtLoginHelper.swift | |
// | |
// Created by Erica Sadun on 4/1/15. | |
// Copyright (c) 2015 Erica Sadun. All rights reserved. | |
// | |
import Foundation | |
public func getLoginItems() -> LSSharedFileList? { |
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
let task = NSTask() | |
task.launchPath = "/bin/sh" | |
task.arguments = ["-c", "sleep 0.2; open \"\(NSBundle.mainBundle().bundlePath)\""] | |
task.launch() | |
NSApplication.sharedApplication().terminate(nil) |
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
#!/usr/bin/env ruby | |
require "openssl" | |
class BF < Struct.new(:key, :pad_with_spaces) | |
def encrypt(str) | |
cipher = OpenSSL::Cipher.new('bf-ecb').encrypt | |
if pad_with_spaces | |
str += " " until str.bytesize % 8 == 0 | |
cipher.padding = 0 |