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
package com.example.libgdxexample; | |
import com.badlogic.gdx.ApplicationListener; | |
public class Game implements ApplicationListener { | |
public void create () { | |
} | |
public void render () { | |
} |
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
package com.example.libgdxexample; | |
import com.badlogic.gdx.backends.lwjgl.LwjglApplication; | |
public class DesktopStarter { | |
public static void main (String[] args) { | |
new LwjglApplication(new Game(), "Game", 480, 320, false); | |
} | |
} |
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
$(document).ready(function() { | |
// Disable caching of AJAX responses | |
$.ajaxSetup ({cache: false}); | |
$('html').ajaxSend(function(event, xhr, settings) { | |
if (!(/^http:.*/.test(settings.url) || /^https:.*/.test(settings.url))) { | |
// Only send the token to relative URLs i.e. locally. | |
xhr.setRequestHeader("X-CSRFToken", $.cookie('csrftoken')); | |
} | |
}); | |
}); |
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
from django.template.loader import add_to_builtins | |
add_to_builtins('django.contrib.staticfiles.templatetags.staticfiles') | |
add_to_builtins('django.templatetags.i18n') | |
add_to_builtins('django.templatetags.future') |
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
package com.example.libgdxexample; | |
import android.os.Bundle; | |
import com.badlogic.gdx.backends.android.AndroidApplication; | |
public class ExampleActivity extends AndroidApplication | |
{ | |
/** Called when the activity is first created. */ | |
@Override | |
public void onCreate(Bundle savedInstanceState) |
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
{% load spurl %} | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
{# the `head-gace-js` block is what you would override in your original template to enable a Google Analytics Content Experiment #} | |
{% block head-gace-js %}{% endblock %} | |
{# by placing this canonical link in your base.html <head> section, all A/B template pages benefit - no duplicate content penalties #} |
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
{% extends "base.html" %} | |
{% block head-gace-js %} | |
// paste your Google Analytics Content Experiment JS code here if you're running an experiment. | |
{% endblock %} | |
{% block content %} | |
<h2>Awesome webpage content for businesses.</h2> | |
{% endblock %} |
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
from django import template | |
from users.forms import EmailSignupForm | |
register = template.Library() | |
@register.assignment_tag | |
def get_signup_form(): | |
return EmailSignupForm() |
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
{% extends "base.html" %} | |
{% load user_tags %} | |
{% block head-gace-js %} | |
// paste your Google Analytics Content Experiment JS code here if you're running an experiment. | |
{% endblock %} | |
{% block content %} | |
<h2>Awesome webpage content for businesses.</h2> | |
{% get_signup_form as signup_form %} |
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
# gunicorn.conf.py: getting gevent and psycogreen running | |
bind = '127.0.0.1:1437' | |
accesslog = "<some-path>/logs/gunicorn-access.log" | |
errorlog = "<some-path>/logs/gunicorn-error.log" | |
workers = 5 | |
try: | |
# fail 'successfully' if either of these modules aren't installed | |
from gevent import monkey | |
from psycogreen.gevent import patch_psycopg |
OlderNewer