Skip to content

Instantly share code, notes, and snippets.

@heckj
heckj / Sphere.swift
Created April 20, 2019 22:28
A Reusable SCNNode SubClass With An SCNSphere Geometry
//
// Sphere.swift
//
//
// Created by Josh Robbins on 24/02/2018.
// Copyright © 2018 BlackMirror. All rights reserved.
//
import Foundation
import SceneKit
@heckj
heckj / Pyramid.swift
Created April 20, 2019 22:28
A Reusable SCNNode SubClass With An SCNPyramid Geometry
//
// Pyramid.swift
//
// Created by Josh Robbins on 24/02/2018.
// Copyright © 2018 BlackMirror. All rights reserved.
//
import Foundation
import SceneKit
@heckj
heckj / SCNText+Typewriter.swift
Created April 20, 2019 22:28
An Example Of Animating SCNText With A Typewriter Like Effect
//1. Timer To Animate Our Text
var animationTimer: Timer?
//2. Variable To Store The Current Time
var time:Int = 0
/// Animates The Presentation Of SCNText To Give An Appearance Of A Typing Effect
///
/// - Parameters:
/// - textGeometry: SCNText
@heckj
heckj / SCNTube.swift
Created April 20, 2019 22:28
A Reusable SCNNode SubClass With An SCNTube Geometry
//
// Tube.swift
//
// Created by Josh Robbins on 24/02/2018.
// Copyright © 2018 BlackMirror. All rights reserved.
//
import Foundation
import SceneKit
@heckj
heckj / MetalWireFrameShader.metal
Created April 20, 2019 22:28
Wireframe Shader For An SCNBox Geometry
/*
Copyright © 2018 Apple Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
@heckj
heckj / Cylinder.swift
Created April 20, 2019 22:24
A Reusable SCNNode SubClass With An SCNCylinder Geometry
//
// Cylinder.swift
//
//
// Created by Josh Robbins on 24/02/2018.
// Copyright © 2018 BlackMirror. All rights reserved.
//
import Foundation
import SceneKit
@heckj
heckj / attributes.rb
Created April 20, 2019 21:33 — forked from lizthegrey/attributes.rb
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
<?xml version="1.0" encoding="UTF-8"?>
<!-- OPML generated by NetNewsWire -->
<opml version="1.1">
<head>
<title>IOSDev.opml</title>
</head>
<body>
<outline text="Official Swift Blog" title="Official Swift Blog" description="" type="rss" version="RSS" htmlUrl="https://developer.apple.com/swift/blog/" xmlUrl="https://developer.apple.com/swift/blog/news.rss"/>
<outline text="Xcoders" title="Xcoders" description="" type="rss" version="RSS" htmlUrl="https://xcoders.org/" xmlUrl="https://xcoders.org/feed.json"/>
<outline text="The Shape of Everything" title="The Shape of Everything" description="" type="rss" version="RSS" htmlUrl="http://shapeof.com/" xmlUrl="http://shapeof.com/feed.json"/>
extension UIImageView {
var contentClippingRect: CGRect {
guard let image = image else { return bounds }
guard contentMode == .scaleAspectFit else { return bounds }
guard image.size.width > 0, image.size.height > 0 else { return bounds }
let scale: CGFloat
let scaleByWidth = bounds.width / image.size.width
let scalebyHeight = bounds.height / image.size.height
### Keybase proof
I hereby claim:
* I am heckj on github.
* I am heckj (https://keybase.io/heckj) on keybase.
* I have a public key ASB6Bo2r9fnLSfcqGzYfIoiIiS9ndQZ1LAzJQno0YwePQgo
To claim this, I am signing this object: