Skip to content

Instantly share code, notes, and snippets.

View ZeroStride's full-sized avatar

Ezri ZeroStride

  • Secret Volcano Lair
View GitHub Profile
@ZeroStride
ZeroStride / gist:3156964
Created July 21, 2012 19:59
Publishing an OpenGL 3.2 FBO to a Syphon server.
CGLLockContext(_syServer.context);
CGLSetCurrentContext(_syServer.context);
[_syServer bindToDrawFrameOfSize:_syTexSz];
GLint syFBO;
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &syFBO);
glBindFramebuffer(GL_READ_FRAMEBUFFER, _blitTarget->framebuffer);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, syFBO);
glBlitFramebuffer(0, 0, _blitTarget->width, _blitTarget->height,
0, 0, _blitTarget->width, _blitTarget->height,
@ZeroStride
ZeroStride / gist:3156985
Created July 21, 2012 20:06
Proposed method for Syphon Server to publish a Framebuffer.
- (void)publishFramebuffer:(GLuint)fboID imageRegion:(NSRect)region textureDimensions:(NSSize)size
{
// TODO: we should probably check we're not already bound and raise an exception here
// to enforce proper use
#if !SYPHON_DEBUG_NO_DRAWING
// check the images bounds, compare with our cached rect, if they dont match, rebuild the IOSurface/FBO/Texture combo.
if(! NSEqualSizes(_surfaceTexture.textureSize, size))
{
[self destroyIOSurface];
[self setupIOSurfaceForSize:size];
@ZeroStride
ZeroStride / CarrotWebHook.js
Created January 19, 2013 23:19
GitHub post-commit hook that posts to Carrot.
var express = require('express');
var crypto = require('crypto');
var carrot = require('./Carrot.min.js');
var carrotAppId = process.env.FACEBOOK_APP_ID;
var carrotAppSecret = process.env.CARROT_SECRET;
var app = express.createServer(express.logger());
app.use(express.bodyParser());
in vec3 InPosition;
in vec2 InTex0;
out vec2 tex_coord0;
out vec4 color0;
uniform vec4 color;
uniform mat4 object_to_screen;
uniform vec2 frame_width_height; // vec2(frame_width, frame_height)
uniform vec2 tex_width_height; // vec2(frame_width * num_animation_frames, frame_height * num_character_ids)
WITH PlayedQuery AS(
SELECT count(*) AS Played, a_title AS Title, event_type FROM AWSMA.event
WHERE event_type='Gif_Played' GROUP BY a_title,event_type
),
CompletedQuery AS(
SELECT count(*) AS Shared, a_title AS Title2, event_type FROM AWSMA.event
WHERE event_type='Share_Completed' GROUP BY a_title,event_type
),
CanceledQuery AS(
SELECT count(*) AS Canceled, a_title AS Title3, event_type FROM AWSMA.event

Keybase proof

I hereby claim:

  • I am zerostride on github.
  • I am zerostride (https://keybase.io/zerostride) on keybase.
  • I have a public key whose fingerprint is AE29 A3AF 0E15 ABF6 C035 D5FA 324E 1611 9800 141F

To claim this, I am signing this object:

#region References
using UnityEditor;
using UnityEditor.Callbacks;
using System;
using System.IO;
using System.Diagnostics;
#endregion
public class PatchIL2CPPConfig
/* Teak -- Copyright (C) 2016 GoCarrot Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
-- http://lua-users.org/wiki/SimpleStats
-- Small stats library --
----------------------------------------------
-- Version History --
-- 1.0 First written.
-- Tables supplied as arguments are not changed.
-- Table to hold statistical functions