Skip to content

Instantly share code, notes, and snippets.

@dcunited001
dcunited001 / metal_compilation_bug
Last active October 5, 2015 11:42
(Metal/XCode) Highly annoying "Multiply defined symbols" bug
i start seeing this whenever i rename metal files in my project. tonight i've spent hours on it and even reinstalled XCode!!
MetalLink /Users/dc/Library/Developer/Xcode/DerivedData/Spectra-ccaaulkvumaoosbyqnspbmxqzurs/Build/Products/Debug-iphoneos/Spectra.framework/default.metallib
cd /Users/dc/dev/apple/Spectra/Example/Pods
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/usr/bin/metallib -o /Users/dc/Library/Developer/Xcode/DerivedData/Spectra-ccaaulkvumaoosbyqnspbmxqzurs/Build/Products/Debug-iphoneos/Spectra.framework/default.metallib /Users/dc/Library/Developer/Xcode/DerivedData/Spectra-ccaaulkvumaoosbyqnspbmxqzurs/Build/Intermediates/Pods.build/Debug-iphoneos/Spectra.build/Metal/default.metal-ar
metallib: Multiply defined symbols _Z19colorShiftWithMVP_1Dv4_fN5metal6matrixI
@dcunited001
dcunited001 / pod-install.out
Created October 3, 2015 04:32
cocoapods wtf
pod install --project-directory=Example --verbose    master  ♥♥♥♥♥
Preparing
Updating local specs repositories
Updating spec repo `master`
$ /usr/bin/git pull --ff-only
Already up-to-date.
CocoaPods 0.39.0.beta.5 is available.
@dcunited001
dcunited001 / basic_triangle.metal
Created September 14, 2015 13:13
basic triangle shader -- why does modulating w affect z??
#include <metal_stdlib>
using namespace metal;
struct BasicTriangleVertexIn {
float4 position;
float4 color;
};
struct BasicTriangleVertexOut {
@dcunited001
dcunited001 / mocks.js
Created May 22, 2015 13:41
Frontend Mocks
//the service('res') around line 900 is a good example of functional programming w/ js
//mocking out the frontend's api's like this allows me to:
// - get a prototype up and running for a new startup as quickly as possible
// - ensure that the prototype appears to run very fast, as the API calls are mocked
// - free instances on heroku are very slow, which is a bad first impression of a product
// - avoid getting stuck in devops, pushing out an API
// - be capable of getting an API up as quickly as possible once I'm ready,
// - since the requests are mocked exactly as Rails would return them
// - experiment with various API frameworks,
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" ng-click="navCollapsed=!navCollapsed">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- TODO: extract site title -->
@dcunited001
dcunited001 / build-error
Last active August 29, 2015 14:20
gradle dex problems
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/Users/dc/Library/Android/sdk/build-tools/21.1.2/dx --dex --no-optimize --output /Users/dc/AndroidStudioProjects/Voxxel/app/build/intermediates/dex/debug --input-list=/Users/dc/AndroidStudioProjects/Voxxel/app/build/intermediates/tmp/dex/debug/inputList.txt
Error Code:
3
Output:
warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.custommonkey.xmlunit.DoctypeInputStream$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
@dcunited001
dcunited001 / foo.clj
Created November 2, 2014 05:00
problems with sorting a map in clojure
;; here i'm not calling persistent/transient in a function and this array is sorted correctly
(def foo {:TAAAGCCTCTGTCC 8, :GAGTAAAACAGATT 1, :TAAAGTACTCAAGT 3, :ATAGTCACAGATTC 4, :CCGCCTCTGTCCGT 8, :CACAGATTCGTACT 2})
(def dataset "GTACTCAAGGCTAATAGTCGCTAATAGTCGCTAATAGTCGCCTCTGTCCGCTAATAGTCACAGATTCACAGATTCGCTAATAGTCGTACTCAAGACAGATTCGCCTCTGTCCGTACTCAAGGCTAATAGTCACAGATTCGCTAATAGTCGTACTCAAGTCGGAGTAAAGCCTCTGTCCGCTAATAGTCACAGATTCACAGATTCTCGGAGTAAAGCCTCTGTCCGCTAATAGTCGTACTCAAGTCGGAGTAAATCGGAGTAAAGCCTCTGTCCTCGGAGTAAAGTACTCAAGACAGATTCGCCTCTGTCCGCCTCTGTCCGTACTCAAGGCCTCTGTCCGCCTCTGTCCTCGGAGTAAAGTACTCAAGTCGGAGTAAAACAGATTCGTACTCAAGACAGATTCTCGGAGTAAAGCCTCTGTCCACAGATTCACAGATTCGTACTCAAGACAGATTCGCCTCTGTCCGCCTCTGTCCACAGATTCGCTAATAGTCTCGGAGTAAAGCCTCTGTCCGCTAATAGTCTCGGAGTAAAGCCTCTGTCCGCTAATAGTCACAGATTCGTACTCAAGGTACTCAAGACAGATTCGTACTCAAGTCGGAGTAAAGCCTCTGTCCTCGGAGTAAAGTACTCAAGTCGGAGTAAAGCTAATAGTCTCGGAGTAAAGCCTCTGTCCGCTAATAGTCGTACTCAAGACAGATTCTCGGAGTAAAGTACTCAAGTCGGAGTAAAGTACTCAAGGCCTCTGTCCTCGGAGTAAATCGGAGTAAAGTACTCAAGGCCTCTGTC
@dcunited001
dcunited001 / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@dcunited001
dcunited001 / designer.html
Last active August 29, 2015 14:06
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<core-toolbar id="core_toolbar">
<core-icon-button icon="menu" id="core_icon_button"></core-icon-button>
<div id="div" flex>Toolbar</div>
</core-toolbar>
@dcunited001
dcunited001 / designer.html
Created September 19, 2014 23:27
designer
<link rel="import" href="../polymer/polymer.html">
<core-toolbar class="tall">
</core-toolbar>