This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
using UnityEditor.SceneManagement; | |
// Adds a "Edit Prefab" option in the Assets menu (or right clicking an asset in the project browser). | |
// This opens an empty scene with your prefab where you can edit it. | |
// Put this script in your project as Assets/Editor/EditPrefab.cs | |
public class EditPrefab { | |
static Object getPrefab(Object selection) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Block { | |
case code(String) | |
case text(String) | |
case header(String) | |
} | |
enum PlaygroundElement { | |
case code(String) | |
case documentation([Block]) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Promise<T> { | |
var value : T? { | |
didSet { | |
if let value = value { | |
notifyListeners(value) | |
} | |
} | |
} | |
init(value : T? = nil) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface UIColor (WBDebugExtensions) | |
@end | |
@implementation UIColor (DebugExtensions) | |
- (id)debugQuickLookObject { | |
UIGraphicsBeginImageContext(CGSizeMake(128, 128)); | |
[self setFill]; | |
[[UIBezierPath bezierPathWithRect:CGRectMake(0, 0, 128, 128)] fill]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PMX 2.0 file format # | |
This is a description of the PMX file format. This is used for 3D models in Miku Miku Dance (MMD). | |
Since I couldn't find any English descriptions of the PMX file format, I've made this, which is translated from http://gulshan-i-raz.geo.jp/labs/2012/10/17/pmx-format1/. I haven't used this file format yet, so please don't ask me what everything means. | |
An English guide to the PMD file format, which preceeded PMX, can be found here: http://mikumikudance.wikia.com/wiki/MMD:Polygon_Model_Data. | |
If you want to learn more, there are some open source projects on GitHub which can read this format, so go take a look at them. | |
Note: fields with type text begins with an int (32 bit) with how many bytes of text the section is. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSURL *url = [NSURL URLWithString:songFileLocation]; | |
AVURLAsset *asset = [AVURLAsset URLAssetWithURL:url options:nil]; | |
[asset loadValuesAsynchronouslyForKeys:@[ @"commonMetadata" ] completionHandler:^{ | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
NSArray *artwork = [AVMetadataItem metadataItemsFromArray:asset.commonMetadata withKey:AVMetadataCommonKeyArtwork keySpace:AVMetadataKeySpaceCommon]; | |
NSImage *image = nil; | |
for (AVMetadataItem *item in artwork) { | |
if ([item.keySpace isEqualToString:AVMetadataKeySpaceID3]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; My implementation of Conways' Game of Life for Notch's DCPU. | |
; Since screen sizes vary, please test it with this online emulator: http://mappum.github.com/DCPU-16/ | |
; It takes about 80k cycles to do a screen update, so have patience :) | |
; Made by Ulrik F. Damm | |
set pc, main | |
:fillboard ; (a: from board, b: to board, x: width, y: height) | |
set i, 0 | |
set j, 0 |