Skip to content

Instantly share code, notes, and snippets.

View q231950's full-sized avatar
🥛

Martin Kim Dung-Pham q231950

🥛
View GitHub Profile
import UIKit
class CenteredTextView: UITextView {
override init(frame: CGRect, textContainer: NSTextContainer?) {
super.init(frame: frame, textContainer: textContainer)
setup()
}
required init?(coder: NSCoder) {
super.init(coder: coder)

##To Install libwkhtmltox

  • Clone the wkhtmltopdf repo git clone --recursive https://github.com/wkhtmltopdf/wkhtmltopdf.git
  • You need the fpm gem to install sudo gem install fpm --no-ri --no-rdoc - it will be installed in /usr/bin so make sure that's in your path.
  • Checkout the latest release tag IE git checkout tags/0.12.2.
  • In the directory and run scripts/build.py osx-cocoa-x86-64(this will take a while! You're building Qt)
  • If you get an error like: error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open file: bin/libwkhtmltox.0.12.2.2.dylib (No such file or directory) all you need to do is match the version in the VERSION file in the base directory to the number between libwkhtmltox. and .dylib of the compiled file in static-build/osx-cocoa-x86-64/app/bin
  • If you're not on OS X, refer to INSTALL.md in the wkhtmltopdf repo for build instructions.
@q231950
q231950 / SystemLog.swift
Last active August 29, 2015 14:27 — forked from kristopherjohnson/SystemLog.swift
Demo of using the Apple System Log (ASL) API from Swift
// Note: This must be used in an Xcode project that contains a bridging header
// that includes <asl.h>
import Foundation
/// Provides high-level methods to access the raw data in
/// an ASL message.
struct SystemLogEntry {
/// Key-value pairs read from ASL message
let data: [String : String]