Skip to content

Instantly share code, notes, and snippets.

View kevinw's full-sized avatar

Kevin Watters kevinw

View GitHub Profile
<label>{{ todo.subject|linkify|safe }}</label>
static void DoScenePicking(SceneView sceneView)
{
var e = Event.current;
if (e.alt || e.control || e.command)
return;
var controlID = GUIUtility.GetControlID(FocusType.Passive);
switch (e.GetTypeForControl(controlID))
{
case EventType.Layout:
### Keybase proof
I hereby claim:
* I am kevinw on github.
* I am kevinw (https://keybase.io/kevinw) on keybase.
* I have a public key ASA_OZcOGdqSktuVSGUXGZeq1d3bGVl8J4zIxEaecvI0UQo
To claim this, I am signing this object:
using UnityEngine;
using UnityEditor;
public static class ResetSelectedTransforms
{
[MenuItem("Utilities/Reset Selected Transforms &z", true)]
static bool ValidateResetSelectedTransforms() { return Selection.activeTransform != null; }
/* Use option-z or alt-z to zero out the position and rotation and set the scale to 1 for
the selected transforms. */
Process: love [1629]
Path: /Users/USER/Downloads/*/love.app/Contents/MacOS/love
Identifier: org.love2d.love
Version: ???
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: love [1629]
User ID: 501
Date/Time: 2015-09-25 13:50:07.635 -0700
@kevinw
kevinw / wat.lua
Created September 25, 2015 05:28
_G['require'] = function(p)
res = nil
if not pcall(function()
res = _require(p)
end) then
if not pcall(function()
res = _require("generated/" .. p)
end) then
res = _require("lib/" ..p)
end
void SetupTrackingObject()
{
NSApplication* app = [NSApplication sharedApplication];
NSWindow* window = [app mainWindow];
view = [window contentView];
if(pTrackMgr != nil)
{
[view setNextResponder:[pTrackMgr nextResponder]];
[pTrackMgr release];
package.path = package.path .. ';generated/?.lua;lib/?.lua'
function love.conf(conf)
conf.window.width = 768
conf.window.height = 1024
conf.window.title = "my title"
conf.modules.joystick = false
end
require "mainmoon"
+ (UIImage *)imageNamed:(NSString *)imageName
fromBytes:(const Byte *)bytes
length:(NSUInteger)length
fromRetinaBytes:(const Byte *)retinaBytes
retinaLength:(NSUInteger)retinaLength {
NSString *bundleName = [FBSettings resourceBundleName];
if (bundleName) {
UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"%@.bundle/%@", bundleName, imageName]];
if (image) {
return image;
class RelatedModelSerializer(serializers.ModelSerializer):
def to_native(self, obj):
ret = super(RelatedModelSerializer, self).to_native(obj)
ret = {
'result': ret
}
for field_name, field in self.get_default_fields():
if instanceof(field, PrimaryKeyRelatedField):