Skip to content

Instantly share code, notes, and snippets.

View jrgleason's full-sized avatar

Jackie Gleason jrgleason

View GitHub Profile
@jrgleason
jrgleason / app.js
Created August 1, 2012 04:15
I had a problem with redirections and node.js so I created this wrapper class for handling it.
app.get('/', function(res, req){
getCookie.execute({
function(err,path,cookie){
handleForward(path,cookie,function(cookie){
//done
})
})
})
})
@jrgleason
jrgleason / index.js
Created August 15, 2012 19:11
Problem with SubFolders in Jade
exports.category = function(req, res){
console.log(JSON.stringify(req.category));
res.render('category/category',{
title:"Category Page",
categories:req.categories,
currcategory:req.category,
err:req.err
})
}
//in main app:
require('./routes').init(app);
//index.js in folder /routes
module.exports =
{
init:function(app){
require('./index')(app);
}
}
@jrgleason
jrgleason / gist:3427481
Created August 22, 2012 16:59
Google OAuth v2 Node.js/Express
//STATICS
var GOOGLE_CLIENT_ID = "",
SSL_PORT = "443",
GOOGLE_CLIENT_SECRET = "",
GOOGLE_URLS = {
USER_INFO: "/oauth2/v1/userinfo",
GET_TOKEN: '/o/oauth2/token',
},
GOOGLE_DOMAINS = {
@jrgleason
jrgleason / layout.jade
Created October 6, 2012 16:47
This is what my jade media query looke like, this doesn't seem to pick up the mobile CSS file. However the stylus media query makes it work fine.
doctype 5
html
head
block head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
link(rel='stylesheet', href='/stylesheets/mobile.css', media='screen and (max-device-width: 480px)')
body
@jrgleason
jrgleason / AndroidManifest.xml
Created January 3, 2013 17:39
Adding the finished AndroidApplication, Screen, and Android Manifest Classes.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.gleason.gametutorial"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<application
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.gleason.superhockey"
android:versionCode="1"
android:versionName="1.1" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.WAKE_LOCK"/>
setLeftPad(Pad.create(world, 50.0f, 30.0f));
setPuck(Puck.create(world, Gdx.graphics.getWidth() / 2,
Gdx.graphics.getHeight() / 2));
@jrgleason
jrgleason / gist:5864664
Created June 26, 2013 03:57
Android.mk for SDL_Net
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := SDL-prebuilt
LOCAL_SRC_FILES := $(LOCAL_PATH)/ext/SDL/$(TARGET_ARCH_ABI)/libSDL.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/ext/include
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := SDL-NET
LOCAL_C_INCLUDES := $(LOCAL_PATH) $(LOCAL_PATH)/include
@jrgleason
jrgleason / gist:5864708
Created June 26, 2013 04:09
JNI C file
#include "game-gl.h"
#include <jni.h>
#include "box2d.hpp"
JNIEXPORT void JNICALL Java_com_gleason_gl_nat_Native_init(JNIEnv* env, jclass class)
{
InitializeOpenGL();
}