Skip to content

Instantly share code, notes, and snippets.

View vi4m's full-sized avatar
:atom:
coding

✪ vi4m Marcin Kliks vi4m

:atom:
coding
View GitHub Profile
@vi4m
vi4m / asciiwwdc.com
Created December 31, 2016 20:09
single page macos swift app webview wrap of http://asciiwwdc.com
#!/usr/bin/swift -target x86_64-apple-macosx10.12 -v
import Cocoa
import WebKit
func halfWindow(title: String = "Half Window (^c to quit)") -> NSWindow {
let window = NSWindow()
if let screen = window.screen {
var frame = screen.visibleFrame
let size = CGSize(width: frame.size.width / 2, height: frame.size.height)
frame = CGRect(origin: .zero, size: size)
@vi4m
vi4m / struct_and_inheritance.swift
Created December 28, 2015 12:46 — forked from AliSoftware/struct_vs_inheritance.swift
Swift-Struct-Inheritance
// #!Swift-1.1
import Foundation
// MARK: - (1) classes
// Solution 1:
// - Use classes instead of struct
// Issue: Violate the concept of moving model to the value layer
// http://realm.io/news/andy-matuschak-controlling-complexity/
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'