Skip to content

Instantly share code, notes, and snippets.

using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using UnityEngine;
struct TimerData {
public string name;
public List<double> times;
}
@andrewzimmer906
andrewzimmer906 / commonprofile.metal
Last active August 29, 2023 20:11 — forked from j-j-m/commonprofile.metal
Can't access GL Uniforms in Metal shader modifier? Apple docs for SCNShadable written in terms of GL? Pulling your hair out?... this will help.
////////////////////////////////////////////////
// CommonProfile Shader v2
#import <metal_stdlib>
using namespace metal;
#ifndef __SCNMetalDefines__
#define __SCNMetalDefines__
@andrewzimmer906
andrewzimmer906 / SubdividedCube.cs
Last active February 28, 2017 13:50
Create a cube with additional vertices in Unity
/**
* Created by Andrew Zimmer.
* 3/27/2017
*
* Free to use and distribute.
*
**/
using System.Collections;
using System.Collections.Generic;
@andrewzimmer906
andrewzimmer906 / Cloud.cs
Created January 21, 2017 15:49
3D Model Generation for a Cloud Object
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
enum Direction {Up, Down, West, East, North, South};
public class Cloud : MonoBehaviour {
public int cloudSizeX = 2;
public int cloudSizeY = 2;
public int cloudSizeZ = 2;
@andrewzimmer906
andrewzimmer906 / UIImage+Color.m
Created June 6, 2013 19:35
Color a UIImage with transparency (in a category).
-(UIImage *)imageWithTint:(UIColor *)color {
// Setup the color
CGFloat redColor;
CGFloat greenColor;
CGFloat blueColor;
CGFloat alphaColor;
[color getRed:&redColor green:&greenColor blue:&blueColor alpha:&alphaColor];
// First get the image into your data buffer
@andrewzimmer906
andrewzimmer906 / Mail_Search.m
Created October 18, 2012 17:54
Search for mail by subject using libetpan for iOS
/*
This function searches a mailimap session for messages with a certain string in their subject line, and returns those messages udid numbers. NOTE: This is called synchronously, so do it in a background thread.
*/
+(NSArray*)searchFolderForString:(NSString*)string withFolderSession:(struct mailimap *)session {
if([string length] == 0) {
return nil;
}
int err;
#!/usr/bin/env ruby
# You might want to change this
ENV["RAILS_ENV"] ||= "daemon"
require File.dirname(__FILE__) + "/../../config/application"
#require 'rubygems'
Rails.application.require_environment!
@andrewzimmer906
andrewzimmer906 / Gemfile
Created September 19, 2012 12:22
MailChimp Integration using Gibbon
# This is done on Rails 3.2.2
# Make sure to define your signup route in routes.rb as a POST
# Mailchimp
gem 'gibbon'
gem 'thin'
@andrewzimmer906
andrewzimmer906 / gist:3145581
Created July 19, 2012 17:44
Post Photo and Message wall with Facebook iOS6 SDK
// Start here https://developers.facebook.com/docs/getting-started/getting-started-with-the-ios-sdk/
// Install the Facebook SDK, get it linked up, create an app, and get that setup correctly
// in your info.plist, appDelegate, and build settings.
//Note: This example uses ARC. If you aren't using ARC, made sure to release/retain objects as needed.
//Now for the fun part.
////////////////////////////