Skip to content

Instantly share code, notes, and snippets.

View kicsipixel's full-sized avatar
🚜
Working hard...

Szabolcs Toth kicsipixel

🚜
Working hard...
View GitHub Profile
@kicsipixel
kicsipixel / CustomWindowDarkMode.swift
Last active November 13, 2018 18:32
CustomWindow with Dark mode
import Cocoa
class CustomWindow: NSWindowController {
// This variable will hold our colours
var windowColor = NSColor(named: "WindowColor") {
didSet {
configureWindowAppearance()
}
}
@kicsipixel
kicsipixel / CustomWindow.swift
Created November 13, 2018 18:07
Custom NSWindow
import Cocoa
class CustomWindow: NSWindowController {
override func windowDidLoad() {
super.windowDidLoad()
self.configureWindowAppearance()
}
@kicsipixel
kicsipixel / CustomButtonCell.swift
Created May 29, 2017 10:02
CustomUI controller
import Cocoa
class CustomButtonCell: NSButtonCell {
override func drawBezel(withFrame frame: NSRect, in controlView: NSView) {
if (self.isHighlighted) {
CustomUI.drawButtonPushed()
} else {
CustomUI.drawButton()
}
@kicsipixel
kicsipixel / ViewController.swift
Created April 28, 2016 18:21
Simple view-based NSTableView
import Cocoa
class ViewController: NSViewController {
@IBOutlet var tableView: NSTableView!
var data: [[String: String]]?
override func viewDidLoad() {
super.viewDidLoad()
@kicsipixel
kicsipixel / gist:7485565
Created November 15, 2013 14:55
I am trying to make this work. Found here: http://help.mandrill.com/entries/23257181-Using-the-Mandrill-Ruby-Gem But I get the following error message all the time: "D, [2013-11-15T17:53:53.464938 #2046] DEBUG -- : HTTPI POST request to mandrillapp.com (excon) /Users/szabolcs/.rvm/gems/ruby-2.0.0-p195/gems/mandrill-0.0.4/lib/mandrill/api.rb:51:i…
require 'mandrill'
m = Mandrill::API.new 'myAPIKey'
message = {
:subject=> "Hello from the Mandrill API",
:from_name=> "Your name",
:text=>"Hi message, how are you?",
:to=>[
{
:email=> "recipient@theirdomain.com",
:name=> "Recipient1"
MKMapRect zoomRect = MKMapRectNull;
for (id <MKAnnotation> annotation in mapView.annotations) {
MKMapPoint annotationPoint = MKMapPointForCoordinate(annotation.coordinate);
MKMapRect pointRect = MKMapRectMake(annotationPoint.x, annotationPoint.y, 0, 0);
if (MKMapRectIsNull(zoomRect)) {
zoomRect = pointRect;
} else {
zoomRect = MKMapRectUnion(zoomRect, pointRect);
}
}