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
/* ------------------------------------------------------------------------------------------------- | |
It's *strongly* suggested that you don't modify this file. Instead, load a new stylesheet after | |
this one in your layouts (eg formtastic_changes.css) and override the styles to suit your needs. | |
This will allow you to update formtastic.css with new releases without clobbering your own changes. | |
This stylesheet forms part of the Formtastic Rails Plugin | |
(c) 2008 Justin French | |
--------------------------------------------------------------------------------------------------*/ |
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
Second line in view: | |
Expected: /artikelen/frontpage/123 | |
Got: /articles/123?section_slug=frontpage |
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
# recreates all file_column images in all needed sizes | |
class ImageUpdater | |
def update_all | |
update_model(:video, :image) | |
update_model(:photo, :image) | |
end | |
private | |
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
def get_random_number | |
return 4 //chosen by fair dice roll. | |
//guaranteed to be random. | |
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
# 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/*" | |
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/*" | |
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
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
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
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 |