Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <SDL2/SDL.h>
#include "glew.h"
//#include <GL/glut.h>
#include <SDL2/SDL_opengl.h>
#include <stdbool.h>
void close(GLuint gProgramID, SDL_Window *window);
bool initGL(GLuint *gProgramID, GLint *gVertexPos2DLocation, GLuint *gVBO, GLuint *gIBO);
void printProgramLog(GLuint program);
# app/jobs/custom_job.rb
class CustomJob < Struct.new(:record_id)
def perform
record = Record.find record_id
record.attachment_one
record.attachment_two
end
end
class ApplicationController < ActionController::Base
protect_from_forgery
force_ssl
helper_method :current_shop, :shopify_session
protected
def current_shop
@current_shop ||= Shop.find(session[:shop_id]) if session[:shop_id].present?
end
@agmcleod
agmcleod / gist:10928358
Created April 16, 2014 20:14
Check for value in string array that has highest count, or collect what the highest ties with
var answers = [
"A",
"B",
"C",
"C"
];
answers.sort();
var types = {};
for(var i = 0; i < answers.length; i++) {
game.PlayScreen = me.ScreenObject.extend({
/**
* action to perform on state change
*/
onResetEvent: function() {
var renderable = me.Renderable.extend({
init: function() {
this.parent(new me.Vector2d(0, 0), me.game.viewport.width, me.game.viewport.height / 2);
this.filled = false;
var _this = this;
/*
* Copyright (c) 2014, Jay Oster
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
game.PlayerEntity = me.ObjectEntity.extend({
init: function(x,y,settings){
this.parent(x,y,settings);
this.setVelocity(4,15);
this.updateColRect(8,48,-1,0);
me.game.viewport.follow(this.pos, me.game.viewport.AXIS.HORIZONTAL);
},
update: function(){
if(me.input.isKeyPressed("left")){
this.flipX(true);
DialogueCompleteEvent nde = new DialogueCompleteEvent() {
@Override
public void complete() {
Layer layer = getLayerByIndex(0);
layer.nextDialogue();
}
};

Talk ideas - HTML5 games

Benefits of HTML5 for games

Distrubition much easier over compiling for different operating systems. Being familiar with Javascript makes it an easy enough transition. Get to be one of the cool kids.

Downsides

Can be harder to monetize. Users are quite used to playing games in their browser for free. Mobile market however is not much different.

(function() {
if(!Math.imul) {
Math.imul = function(x, y) { return x * y; };
}
var MB = 1024 * 1024;
var SIZE = 256 * MB;
var STACK_SIZE = 2 * MB;
var HEAP_SIZE = SIZE - STACK_SIZE;