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
# Automatically activate Git projects' virtual environments based on the | |
# directory name of the project. Virtual environment name can be overridden | |
# by placing a .venv file in the project root with a virtualenv name in it | |
function workon_cwd { | |
# Check that this is a Git repo | |
GIT_DIR=`git rev-parse --git-dir 2> /dev/null` | |
if [ $? == 0 ]; then | |
# Find the repo root and check for virtualenv name override | |
GIT_DIR=`\cd $GIT_DIR; pwd` | |
PROJECT_ROOT=`dirname "$GIT_DIR"` |
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
<a class="btn">My Button</a> |
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 tastypie import fields | |
from tastypie.bundle import Bundle | |
class FastDehydratableForeignKey(fields.ForeignKey): | |
def dehydrate(self, bundle): | |
if isinstance(bundle, Bundle): | |
other_resource = self.to_class() | |
if hasattr(other_resource, '_meta') and other_resource._meta.object_class: | |
fk_field = bundle.obj._meta.get_field(self.attribute) |
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
#!/bin/bash | |
# (Re)spawn the application | |
function spawn () { | |
local ps_name=$1 | |
local spawn_cmd=$2 | |
local pids=`ps -C $ps_name -o pid=` | |
if [ ${#pids} -ne 0 ] | |
then | |
echo "Sending TERM to $pids..." |
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
// In ResourceLoader.java I added the following method: | |
// | |
public void loadLibraryProjectResources(File libraryProjectRoot) throws Exception { | |
File systemResourceDir = getSystemResourceDir(getPathToAndroidResources()); | |
File localValueResourceDir = getValueResourceDir(libraryProjectRoot); | |
File systemValueResourceDir = getValueResourceDir(systemResourceDir); | |
loadStringResources(localValueResourceDir, systemValueResourceDir); | |
loadPluralsResources(localValueResourceDir, systemValueResourceDir); | |
loadValueResources(localValueResourceDir, systemValueResourceDir); |
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
// see: http://www.java-gaming.org/index.php?topic=23640.0 | |
Application.getApplication().setQuitHandler(new QuitHandler() { | |
@Override | |
public void handleQuitRequestWith(AppEvent.QuitEvent quitEvent, QuitResponse quitResponse) { | |
Gdx.app.exit(); | |
} | |
}); |
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
/* | |
Copyright (c) 2012. HappyDroids LLC <[email protected]> | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTIO |
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
import aurelienribon.tweenengine.Tween; | |
import aurelienribon.tweenengine.TweenAccessor; | |
import com.unhappyrobot.entities.GameObject; | |
public class GameObjectAccessor implements TweenAccessor<GameObject> { | |
static { | |
Tween.registerAccessor(GameObject.class, new GameObjectAccessor()); | |
} | |
public static final int POSITION = 1; |
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
class ApplicationViewTests(SeleniumTestCase): | |
def test_django_test_server_is_running(self): | |
self.login() | |
with self.navigate_to('/admin') as page: | |
expect(page).to_have_selector('#user-tools') | |
expect(page.find('#user-tools')).to_contain_text('Welcome, pplante.') | |
def login(self, username=None, password=None): |
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
// Copyright (C) 2011 Philip Plante <@pplante> | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: | |
// | |
// The above copyright notice and this permission notice shall be included in |
NewerOlder