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
using System; | |
using Microsoft.Xna.Framework; | |
using Microsoft.Xna.Framework.Content; | |
using Microsoft.Xna.Framework.Media; | |
namespace XELibrary | |
{ | |
public class DefaultBackgroundMusicPlaybackService: IBackgroundMusicPlaybackService | |
{ | |
public DefaultBackgroundMusicPlaybackService(ContentManager contentManager) |
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
#!/usr/bin/env ruby | |
rb_files = Dir.glob("**/*.rb").join(" ") | |
system("wc -l #{rb_files}") |
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 ApprovedCampaignApplication::DataFeedsController < ApplicationController | |
def index | |
active_approved_campaign_application_status = ApprovedCampaignApplicationStatus.find_by_code("ACT") | |
end | |
end |
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
# Using this code, I can build the XML document, but there's garbage at the end of the document (see the notes below). | |
# I'm not sure if there's any extra configuration needed, but I can't use 'render :xml' to render it (I think it's related to the way Builder actually works) | |
xml_markup = Builder::XmlMarkup.new | |
xml_markup.instruct! | |
xml_markup.products do | |
@products.each do |product| | |
@product_commission_url = "#{network.full_base_url}t2/#{network.id}/@@SIDEID@@/#{creative_id}/@@OPT?link=#{CGI.escape(product.url)}" | |
xml_markup.product do |
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
require "rubygems" | |
require "gosu" # sudo gem install gosu | |
class FontRenderingWindow < Gosu::Window | |
FRAMES_BEFORE_ADDING_NEW_STRING = 90 | |
def initialize | |
super(1280, 720, false) | |
self.caption = "Memory Fail?" | |
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 helloworld.polls.models import Poll | |
from django.shortcuts import render_to_response, get_object_or_404 | |
from django.http import HttpResponse, HttpResponseRedirect | |
def index(request): | |
latest_poll_list = Poll.objects.all().order_by('-pub_date')[:5] | |
return render_to_response('polls/index.html', {'latest_poll_list': latest_poll_list}) | |
def detail(request, poll_id): | |
poll = get_object_or_404(Poll, pk=poll_id) |
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
# Due to the way OS 10.5's default Ruby install has it's initial gems configured, | |
# you can't fire off a simple 'sudo gem cleanup' to remove old RubyGems. | |
# | |
# This script will iterate through all the gems you have installed, | |
# and manually run 'sudo gem cleanup' on that particular RubyGem. | |
# | |
# NB: Due to how the initial gems (Rails 1.x, old Rake, etc.) are installed | |
# you might get a pause around handling the cleanup of those. | |
# | |
`gem list --local`.split("\n").each do |gem_details| |
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
Instructions: | |
- General | |
Destroy Meteors to score points | |
Use Hyperspace to get out of tricky situations | |
Extra life every 5000 points | |
- Meteor Swarm | |
Clear the wave before time runs out | |
Larger Meteors take more shots before exploding! |
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
# Cleans out Safari 4's website previews - these can rapidly consume a large amount of disk space :/ | |
path = "/private/var/folders/so/soew68z1HjWMADz0uUh4GE+++TI/-Caches-/com.apple.Safari/Webpage Previews" | |
Dir.foreach(path) do |entry| | |
file_path = "#{path}/#{entry}" | |
File.delete(file_path) unless File.directory?(file_path) | |
end |
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
public override void HandleInput() | |
{ | |
if (!IsActive) return; | |
#if XBOX | |
if (!playerInputMapper.IsConnected || playerInputMapper.Pause) | |
#else | |
if (playerInputMapper.Pause) | |
#endif | |
AddExtraScreen(new PauseMenuScreen()); |
OlderNewer