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 File.dirname(__FILE__) + '/../test_helper' | |
require "selenium/client" | |
class HelloTest < ActiveSupport::TestCase | |
def setup | |
@verification_errors = [] | |
@selenium = Selenium::Client::Driver.new \ | |
:host => "localhost", | |
:port => 4444, | |
:browser => "*safari", |
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
# Is this the proper way to detect whether any of the params has a nil value? | |
# I think it's being superseded by the before_filter because I see | |
# /Users/kaimiddleton/Sites/thundercat/vendor/plugins/fixie_whitelister/lib/white_list_helper.rb:34:in `strip_naughty_stuff' | |
# when I hit the browser with, say, http://localhost:3000/?/ | |
class MainController < ApplicationController | |
skip_before_filter :require_restrictive_access | |
before_filter :main_sidebar, :only => [:index, :landing_page] | |
def index |
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
<? | |
# PHP Quine written by Ian Kjos - [email protected] | |
$y = "function q(\$q) { | |
\$q = str_replace('\\\\', '\\\\\\\\', \$q); | |
\$q = str_replace('\$', '\\\\\$', \$q); | |
\$q = str_replace('\\n', '\\\\n', \$q); | |
\$q = str_replace('\"', '\\\\\"', \$q); | |
return \$q; | |
} |
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 Ckeditor::Picture < Ckeditor::Asset | |
has_attached_file :data, | |
:url => "/ckeditor_assets/pictures/:id/:style_:basename.:extension", | |
:path => ":rails_root/public/ckeditor_assets/" + | |
"pictures/:id/:style_:basename.:extension", | |
:styles => {:content => '800>', :thumb => '118x100#'} | |
# etc.... | |
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
// Theory of computation: halting problem: will the following program ever halt? | |
outer_loop: | |
for (let bound=3; ; bound++) | |
for (let n=3; n<=bound; n++) | |
for (let a=1; a<=bound; a++) | |
for (let b=1; b<=bound; b++) | |
for (let c=1; c<=bound; c++) | |
if (a**n + b**n == c**n) | |
break outer_loop; |
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 java.util.*; | |
public class Stack { | |
private Object[] elements; | |
private int size = 0; | |
public Stack(int initialCapacity) { | |
this.elements = new Object[initialCapacity]; | |
} | |
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
#define W32_BUILD | |
#undef W32_BUILD | |
#ifdef W32_BUILD | |
#define NTDDI_VERSION 0x05010200 | |
#define _WIN32_WINNT 0x0501 | |
#endif | |
#ifndef W32_BUILD | |
#define HNI |
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
/***************************************************************************/ | |
/* micro-Max, */ | |
/* A chess program smaller than 2KB (of non-blank source), by H.G. Muller */ | |
/***************************************************************************/ | |
/* version 4.0 (1752 characters) features: */ | |
/* - recursive negamax search */ | |
/* - quiescence search with recaptures */ | |
/* - recapture extensions */ | |
/* - (internal) iterative deepening */ | |
/* - best-move-first 'sorting' */ |
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
(defn apply | |
"Applies fn f to the argument list formed by prepending intervening arguments to args." | |
{:added "1.0" | |
:static true} | |
([^clojure.lang.IFn f args] | |
(. f (applyTo (seq args)))) | |
([^clojure.lang.IFn f x args] | |
(. f (applyTo (list* x args)))) | |
([^clojure.lang.IFn f x y args] | |
(. f (applyTo (list* x y args)))) |
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
<div id="example"> | |
<div id="div-before"> | |
<p>id = div-before</p> | |
</div> | |
<div id="div-1"> | |
<div id="div-1-padding"> | |
<p>id = div-1</p> | |
<div id="div-1a"> | |
<p>id = div-1a</p> | |
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer pretium dui sit amet felis. Integer sit amet diam. Phasellus ultrices viverra velit.</p> |
OlderNewer