View bt-agent.service
# in /etc/systemd/system | |
[Unit] | |
Description=Bluetooth Agent | |
[Service] | |
ExecStart=/usr/bin/bt-agent -c NoInputNoOutput | |
Type=simple | |
[Install] | |
WantedBy=multi-user.target |
View save-and-restore-contenteditable-selection.js
function saveSelection() { | |
if (window.getSelection) { | |
var sel = window.getSelection(); | |
if (sel.getRangeAt && sel.rangeCount) { | |
return sel.getRangeAt(0); | |
} | |
} else if (document.selection && document.selection.createRange) { | |
return document.selection.createRange(); | |
} | |
return null; |
View CircleNode.swift
import SpriteKit | |
class CircleNode: SKShapeNode { | |
var radius: CGFloat { | |
didSet { | |
self.path = CircleNode.path(self.radius) | |
} | |
} | |
View multilinesegmentedcontrol.swift
extension UISegmentedControl | |
{ | |
func makeMultiline(numberOfLines: Int) | |
{ | |
for segment in self.subviews | |
{ | |
let labels = segment.subviews.filter { $0 is UILabel } // [AnyObject] | |
labels.map { ($0 as UILabel).numberOfLines = numberOfLines } | |
} | |
} |
View UIImage+Tinting.swift
/** | |
Usage: | |
let originalImage = UIImage(named: "cat") | |
let tintedImage = originalImage.tintWithColor(UIColor(red: 0.9, green: 0.7, blue: 0.4, alpha: 1.0)) | |
*/ | |
extension UIImage { | |
func tintWithColor(color:UIColor)->UIImage { |
View Apple Evangelists.txt
UI- and App Frameworks Evangelist - Jake Behrens, behrens@apple.com, twitter: @Behrens | |
- What's new in Cocoa | |
- Accessibility in iOS | |
- Building User Interfaces for iOS 7 | |
- Getting Started with UIKit Dynamics | |
- What's new in Cocoa Touch | |
- What's New With Multitasking | |
- Best Practices for Cocoa Animation | |
- Improving Power Efficiency with App Nap | |
- Introducing Text Kit |
View capture_raw_frames.c
/* | |
* V4L2 video capture example | |
* | |
* This program can be used and distributed without restrictions. | |
* | |
* This program is provided with the V4L2 API | |
* see http://linuxtv.org/docs.php for more information | |
*/ | |
#include <stdio.h> |