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
## | |
# test/spec/mini 3 | |
# http://gist.github.com/25455 | |
# [email protected] | |
# file:lib/test/spec/mini.rb | |
# | |
def context(*args, &block) | |
return super unless (name = args.first) && block | |
require 'test/unit' | |
klass = Class.new(defined?(ActiveSupport::TestCase) ? ActiveSupport::TestCase : Test::Unit::TestCase) 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
@implementation CPTextView : CPView | |
{ | |
DOMElement FIXME_textArea; | |
id _delegate; | |
CPScrollView _scrollView; | |
CPView _contentView; | |
JSObject _existingSelectStart; |
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
;; this file is a walkthrough of Moustache features, a web framework for Clojure | |
;; http://github.com/cgrand/moustache/tree/master | |
;; Moustache allows to declare routes, apply middlewares and dispatch on http methods. | |
;; Moustache is compatible with all frameworks built on Ring, including Compojure | |
(ns demo | |
(:use net.cgrand.moustache) | |
(:use [ring.adapter.jetty :only [run-jetty]])) ;; hmmm Ring without servlets | |
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
--- markdown.php 2009-10-10 10:11:04.000000000 -0400 | |
+++ markdown-geshi.php 2010-06-16 16:54:51.000000000 -0400 | |
@@ -2,6 +2,11 @@ | |
# | |
# Markdown Extra - A text-to-HTML conversion tool for web writers | |
# | |
+# GeSHI addition by Eric Leclerc | |
+# uses GeSHI 1.0.8.8. add a shebang line as the first line of your | |
+# code block to trigger GeSHI parsing/highlighting, ie: | |
+# #!php |
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
Warden::Strategies.add(:bcrypt) do | |
def valid? | |
params[:username] || params[:password] | |
end | |
def authenticate! | |
return fail! unless user = User.first(:username => params[:username]) | |
if user.encrypted_password == params[:password] | |
success!(user) |
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/sh | |
CUR_DIR=$PWD | |
PID_FILE="$CUR_DIR/node.pid" | |
if [ $1 = "start" ]; then | |
if [ -e $PID_FILE ]; then | |
echo "Node.js is already running." | |
else | |
echo "Starting Node Server" |
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/sh -e | |
# | |
# Usage: browser | |
# pipe html to a browser | |
# e.g. | |
# $ echo '<h1>hi mom!</h1>' | browser | |
# $ ron -5 man/rip.5.ron | browser | |
if [ -t 0 ]; then | |
if [ -n "$1" ]; then |
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
; response to http://toinfinity.wordpress.com/2010/05/01/does-groovy-know-you-are-seeing-clojure | |
; tell the gnomes! phase two is (map - closing-prices)! | |
; prior to 1.2, reductions is in clojure.contrib.seq-utils | |
(->> (reductions min closing-prices) ;; lowest prices at each point | |
(map - closing-prices) ;; possible profit at each point | |
(apply max)) ;; profit! | |
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) 2010 Tobias Schneider | |
* This script is freely distributable under the terms of the MIT license. | |
*/ | |
(function(){ | |
var UPC_SET = { | |
"3211": '0', | |
"2221": '1', | |
"2122": '2', |
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
/* | |
* AppController.j | |
* imdbdemo | |
* | |
* Created by Randy Luecke on July 2, 2010. | |
* Copyright 2010, RCLConcepts, LLC All rights reserved. | |
*/ | |
@import <Foundation/CPObject.j> | |
@import <AppKit/CPScrollView.j> |
OlderNewer