This file contains hidden or 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.noir.clientv2.handlers; | |
import com.jme.input.InputHandler; | |
import com.jme.input.KeyBindingManager; | |
import com.jme.input.KeyInput; | |
import com.jme.input.action.InputAction; | |
import com.jme.input.action.InputActionEvent; | |
import com.jmex.game.state.GameState; | |
import com.noir.clientv2.NoirClientV2; | |
This file contains hidden or 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
SELECT `articles`.*, `priorities`.position | |
FROM `articles` | |
LEFT OUTER JOIN `priorities` ON priorities.article_id = articles.id | |
WHERE (`articles`.`status` = 1) | |
ORDER BY priorities.position ASC, created_at DESC LIMIT 0, 20 |
This file contains hidden or 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
# STI, this is the base model which is stored in the database | |
class Character < ActiveRecord::Base | |
belongs_to :location | |
def move_to(new_location) | |
update_attribute(:location_id, new_location.id) | |
# or: | |
# self.location = new_location | |
# save |
This file contains hidden or 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
You have a nil object when you didn't expect it! | |
The error occurred while evaluating nil.protect_against_forgery? |
This file contains hidden or 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 Article < ActiveRecord::Base | |
# Nothing to do here really... | |
end |
This file contains hidden or 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 'rss/1.0' | |
require 'rss/2.0' | |
require 'hpricot' | |
require 'open-uri' | |
# This is an abstract InputHandler. | |
# | |
# InputHandlers fetch, parse and store articles from and RSS feed. | |
# All InputHandlers should extend this class. | |
class InputHandler |
This file contains hidden or 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 java.io.*; | |
public class TestSer { | |
public static void main(String[] args) { | |
SpecialSerial s = new SpecialSerial(); | |
try { | |
ObjectOutputStream os = new ObjectOutputStream( | |
new FileOutputStream("myFile")); | |
os.writeObject(s); os.close(); | |
This file contains hidden or 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 java.util.regex.*; | |
class Regex2 { | |
public static void main(String[] args) { | |
Pattern p = Pattern.compile(args[0]); | |
Matcher m = p.matcher(args[1]); | |
boolean b = false; | |
while(b = m.find()) { | |
System.out.print(m.start() + m.group()); | |
} |
This file contains hidden or 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
# 1) Point *.example.com in your DNS setup to your server. | |
# | |
# 2) Setup an Apache vhost to catch the star pointer: | |
# | |
# <VirtualHost *:80> | |
# ServerName *.example.com | |
# </VirtualHost> | |
# | |
# 3) Set the current account from the subdomain | |
class ApplicationController < ActionController::Base |
This file contains hidden or 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
# Link to local copy of edge rails | |
inside('vendor') { run 'ln -s ~/rails/rails rails' } | |
# Delete unnecessary files | |
run "rm README" | |
run "rm public/index.html" | |
run "rm public/favicon.ico" | |
run "rm public/robots.txt" | |
run "rm -f public/javascripts/*" | |
OlderNewer