Skip to content

Instantly share code, notes, and snippets.

Skye Book skyebook

Block or report user

Report or block skyebook

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:8d36d34a4de712956f47d1c41f020e22
https://github.com/nvidia/nvidia-docker/wiki/Installation-(version-2.0)
ubuntu desktop 18.04 w/ minimal install
@skyebook
skyebook / CVPixelBufferPixelFormatNames.swift
Created Mar 24, 2017
Easily get the pixel format name of a CVPixelBuffer
View CVPixelBufferPixelFormatNames.swift
public func CVPixelBufferGetPixelFormatName(pixelBuffer: CVPixelBuffer) -> String {
let p = CVPixelBufferGetPixelFormatType(pixelBuffer)
switch p {
case kCVPixelFormatType_1Monochrome: return "kCVPixelFormatType_1Monochrome"
case kCVPixelFormatType_2Indexed: return "kCVPixelFormatType_2Indexed"
case kCVPixelFormatType_4Indexed: return "kCVPixelFormatType_4Indexed"
case kCVPixelFormatType_8Indexed: return "kCVPixelFormatType_8Indexed"
case kCVPixelFormatType_1IndexedGray_WhiteIsZero: return "kCVPixelFormatType_1IndexedGray_WhiteIsZero"
case kCVPixelFormatType_2IndexedGray_WhiteIsZero: return "kCVPixelFormatType_2IndexedGray_WhiteIsZero"
case kCVPixelFormatType_4IndexedGray_WhiteIsZero: return "kCVPixelFormatType_4IndexedGray_WhiteIsZero"
View keybase.md

Keybase proof

I hereby claim:

  • I am skyebook on github.
  • I am sbook (https://keybase.io/sbook) on keybase.
  • I have a public key ASB9pH5ppMwX5I_fKyUwX31eddw5yrLUwALDA44PUH-gGAo

To claim this, I am signing this object:

@skyebook
skyebook / lock.css
Created Mar 15, 2017 — forked from visnup/lock.css
"lock" orientation of a website for mobile (iPad, iPhone)
View lock.css
/* if portrait mode is detected, rotate the entire site -90 degrees to hint rotating to landscape */
@media (orientation: portrait) {
body {
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
transform: rotate(-90deg);
}
}
View ObjectsAtIndexPaths.swift
extension Array {
func objectsAtIndexPaths(indexPaths: [NSIndexPath]) -> [Element] {
return indexPaths.map {self[$0.row]}
}
}
@skyebook
skyebook / swoon.swift
Created May 13, 2016
I love array functions.
View swoon.swift
@objc private func filterSelected(filterButton: FilterSelectButton) {
orderedButtons.filter{return $0 != filterButton}.forEach{$0.selected = false}
}
View every.swift
// Is every point in this rectangle? This would be easy in JS.
let containsAllPoints = points.reduce(true) { return !$0 ? $0 : CGRectContainsPoint(rect, $1)}
View ListUtils.java
package donald.trump.for.president;
import java.util.List;
public class ListUtils {
/**
* Return a list containing, at most, the number of requested objects. If
* there are less than <code>count</code> items present, all items in the
* list are returned.
@skyebook
skyebook / ExportWindow.mel
Last active Aug 29, 2015
Betaville Batch Exporter for Maya
View ExportWindow.mel
-title "RE-Export building .DAE"
-widthHeight 100 100;
rowLayout -numberOfColumns 2;
columnLayout -adjustableColumn true;
button -label "A-------MoveTool-----------------"
-command
MoveTool;
EnterEditMode;
ctxEditMode;
button -label "B-------CenterPivot-------------"
@skyebook
skyebook / UnfuckedButton.m
Created Feb 1, 2015
Put titleLabel under UIButtton imageView
View UnfuckedButton.m
- (CGRect)titleRectForContentRect:(CGRect)contentRect
{
// Can't reference titleLabel directly in here, so get the frame by calling into the UIButton implementation
CGRect defaultTitleFrame = [super titleRectForContentRect:contentRect];
CGSize titleSize = defaultTitleFrame.size;
CGPoint imageCenter = self.imageView.center;
return CGRectMake(imageCenter.x - (titleSize.width/2), imageCenter.y+titleSize.height, titleSize.width, titleSize.height);
}
You can’t perform that action at this time.