Skip to content

Instantly share code, notes, and snippets.

View DaveAtDog's full-sized avatar

Dave Lochhead DaveAtDog

View GitHub Profile
@DaveAtDog
DaveAtDog / positionObjectsOnSphereSurface.js
Last active June 9, 2016 14:26
My preferred way of positioning 3D objects on the surface of a sphere.
// Based on example C# code from http://forum.unity3d.com/threads/evenly-distributed-points-on-a-surface-of-a-sphere.26138/#post-2031195
// objects is an array of THREE.js 3D Objects
function positionObjectsOnSphereSurface(objects) {
var radius = 900;
var n = objects.length;
var inc = Math.PI * (3 - Math.sqrt(5));
var off = 2 / n;
var x = 0;
var y = 0;
var z = 0;
@learncodeacademy
learncodeacademy / webpack.config.js
Created January 8, 2016 03:55
Sample Basic Webpack Config
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
filename: "scripts.min.js"
@kellyegan
kellyegan / ViewController.swift
Last active April 2, 2023 00:57
Send emails with attachments in iOS using Swift
//
// ViewController.swift
// SendEmailWithAttachment
//
// Created by Kelly Egan on 3/17/15.
// Copyright (c) 2015 Kelly Egan. All rights reserved.
//
import UIKit
import MessageUI
@asanocorp
asanocorp / looping gwd comp
Last active August 29, 2015 14:06
looping gwd comp
https://groups.google.com/d/msg/gwdbeta/WFi3b12fKLU/TB-8hDqnEvcJ
----------
Hi GWD team
Have you figured out yet how to add simple loop timeline animation control. Ive read a few hack options but i was wondering if there is something stable and easy to use.
Im building MPU deployed to Doubleclick studio for a client and it's a requirement for the banner to loop twice. Any help would be much appreciated.
@bomberstudios
bomberstudios / sketch-plugins.md
Last active February 26, 2024 07:02
A list of Sketch plugins hosted at GitHub, in no particular order.
@DaveAtDog
DaveAtDog / Xcode 5 - Build Number Increment
Created November 5, 2013 16:38
Auto-increments Build numbers. App (Top left) > Edit Scheme > Build > Pre-actions + Run New Script Action Provide build settings from *APP* Paste in script below. GOTCHA: Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}")
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}"
@DaveAtDog
DaveAtDog / DLog
Last active December 27, 2015 11:49
DLog - NSLog replacement - Stick in *-Prefix.pch file. Storing here for my own sanity.
#ifdef DEBUG
#define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
#define DLog(...)
#endif
@jbenet
jbenet / simple-git-branching-model.md
Last active June 17, 2024 14:53
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@joesepi
joesepi / gist:6299513
Last active December 21, 2015 11:29
How to get SublimeLinter working in Sublime Text 3 (ST3)

How to get SublimeLinter working in SublimeText3 (ST3)

This shouldn't be that hard.

I have done a number of things over the last few hours to get this to work and I wasn't taking notes, so this is what I think needs to happen to install SublimeLinter in ST3

The first thing you need to do is uninstall SublimeLinter if you have it installed:

  • Assuming you have Package Controll installed, hit Cmd + Shift + P to bring up the panel and type "remove" and choose "Package Control: Remove Package" and then choose SublimeLinter from the resulting menu

Let's really make sure that all of that SublimeLinter stuff is gone:

  • Navigate to ~/Library/Application\ Support/Sublime\ Text\ 3/
@marcboquet
marcboquet / Variables.plist
Created July 16, 2013 15:50
Soulver variables useful for iOS design. Based on ‏@marcedwards post: http://bjango.com/articles/soulver/
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SKVariables</key>
<array>
<dict>
<key>enabled</key>
<true/>
<key>name</key>