Skip to content

Instantly share code, notes, and snippets.

View jungchris's full-sized avatar
🏠
Working from home

Chris Jungmann jungchris

🏠
Working from home
View GitHub Profile
@jungchris
jungchris / Icosahedron.m
Last active January 26, 2016 23:39
A Gist to Create a 20 Sided Icosphere
/////////////////////////////////////////////////////////////////
// Declare data types
// This data type is used to store information for each vertex
typedef struct {
GLKVector3 positionCoords;
}
SceneVertex;
/////////////////////////////////////////////////////////////////
// Define vertex data for a triangle to use in example
@jungchris
jungchris / Tetrahedron.m
Last active February 5, 2016 19:15
Objective-C Method to Create a Four Sided 3-D Polyhedron
// Method to calc a four sided polyhedron
- (void)createTetrahedron {
// constants & vars based on four faces (triangles)
int trianglesAroundZ = 3; // arbitrary choice of z axis
float seedPointAngle = 90.0; // first point P1 vertex angle from x-y plane
float distanceToOrigin = 1.0;
float angleBetweenPoints = 360/trianglesAroundZ;
// determine cone aspects
// Chris Jungmann Metal Experimentation
// Based on Ray Wenderlich's tutorial
// http://www.raywenderlich.com/77488/ios-8-metal-tutorial-swift-getting-started
//
import UIKit
import Metal
import QuartzCore // had to set to Generic iOS Device for this to import properly
// http://www.raywenderlich.com/forums/viewtopic.php?f=20&t=18159&start=40
@jungchris
jungchris / ItemModel.swift
Created April 15, 2016 14:31
Swift ItemModel
//
// ItemModel.swift
// HelloToDoSwift
//
// Created by Chris Jungmann on 4/2/16.
// Copyright © 2016 Chris Jungmann. All rights reserved.
//
// http://nshipster.com/nscoding/
import UIKit
@jungchris
jungchris / AddItem.swift
Created April 15, 2016 14:40
Controller to add an item in Swift
//
// AddStuffVC.swift
// HelloToDoSwift
//
// Created by Chris Jungmann on 4/1/16.
// Copyright © 2016 Chris Jungmann. All rights reserved.
//
import UIKit
@jungchris
jungchris / SeatModel.swift
Last active April 15, 2016 15:35
Encode with Coder
func initWithCoder(aDecoder:NSCoder ) -> instancetype {
self = super.init()
self.seatUUID = aDecoder.decodeObjectForKey("seatUUID")
self.seatManuID1 = aDecoder.decodeObjectForKey("seatManuID1")
self.seatManuID2 = aDecoder.decodeObjectForKey("seatManuID2")
self.seatDataStructure = aDecoder.decodeObjectForKey("seatDataStructure")
self.seatBabyPresent = aDecoder.decodeObjectForKey("seatBabyPresent")
self.seatBatteryLevel = aDecoder.decodeObjectForKey("seatBatteryLevel")
self.seatSignalStrength = aDecoder.decodeObjectForKey("seatSignalStrength")
@jungchris
jungchris / ViewController.swift
Created April 15, 2016 15:43
Controller for ToDo App
//
// ViewController.swift
// HelloToDoSwift
//
// Created by Chris Jungmann on 4/1/16.
// Copyright © 2016 Chris Jungmann. All rights reserved.
//
import UIKit
@jungchris
jungchris / app.css
Created December 5, 2016 01:21
Scoreboard Application to Learn React
body {
background: #d5d5d5;
font-family: arial;
color: #FAFAFA;
text-transform: uppercase;
}
.scoreboard {
background: #333;
width: 700px;
@jungchris
jungchris / AppBeta.js
Last active December 10, 2016 00:34
Creating Random React Components
import React from 'react';
import Child from './Child';
import Child2 from './Child2';
// const App = () => <h1>ReactDOM</h1>
// class App extends React.Component {
// render() {
// return <h1>Reactly</h1>
// }
// I love this way of creating a superclass as a bind helper method,
// rather than binding in the constructor as follows:
/*
constructor() {
super();
this. _handleClick = this. _handleClick.bind(this);
this. _handleFoo = this. _handleFoo.bind(this);
}
*/
// we bind in the BaseComponent instead using forEach with a fat arrow function