Skip to content

Instantly share code, notes, and snippets.

Host blablabla
    Port blub
@firefightingcode
firefightingcode / UILabel+Spacing.swift
Created November 26, 2015 15:02
An extension for UILabel to set text with specific kerning, line spacing or line height multiple
import UIKit
extension UILabel {
func setText(text: String, withKerning kerning: Double) {
self.attributedText = NSAttributedString(string: text, attributes: kerningAttribute(kerning))
}
func setText(text: String, withLineSpacing lineSpacing: CGFloat) {
self.attributedText = NSAttributedString(string: text, attributes: lineSpacingAttribute(lineSpacing))
@firefightingcode
firefightingcode / pebble_deploy.py
Created April 4, 2014 12:04
This little script watches for changes made to the source files of your Pebble project and automatically builds and installs the app or watchface to your smartphone.
import sys
import time
from subprocess import call
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler
class ChangeHandler(PatternMatchingEventHandler):
patterns = ["*.c", "*.h", "*.json"]
def on_any_event(self, event):