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
/** | |
* A helper for embedding gists from http://gist.github.com/ | |
* @param args the gist to embed full URL or ID only | |
* - asyncLoad - will load gist via ajax (non-blocking) | |
* - loadHTML - the HTML to use while gist is not loaded | |
* - removeStyleLink removes the embedded css link (useful | |
* for custom gist styling) | |
*/ | |
function embedGist(args) { | |
if ( ! args ) throw 'no arguments given'; |
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
// Licensed under the "Apache License, Version 2.0" (c) 2010 | |
/** | |
* Returns filenames found by expanding the passed pattern which is String or | |
* a List of patterns. | |
* NOTE: that this pattern is not a regexp (it’s closer to a shell glob). | |
* NOTE: that case sensitivity depends on your system. | |
* | |
* <code>*</code> Matches any file. Can be restricted by other values in | |
* the glob pattern (same as <code>.*</code> in regexp). | |
* <code>*</code> will match all 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
// all .jsp and .jspf not starting with '_' | |
def jsps = File.glob( "**/[^_]*.js{p|pf}" ) |
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
function removeGistStyleLink(writes) { | |
// removing embed.css | |
if ( writes ) { // defered load | |
for (var i=0; i<writes.length; i++) { | |
var tagStart = writes[i].substring(0, 5); | |
if (tagStart.toLowerCase() == '<link') { | |
writes[i] = ''; break; // only 1 css | |
} | |
} | |
} |
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
# Extension of the ActiveRecord's Dirty module to enable | |
# tracking changes even after the record has been saved | |
# (as ActiveRecord's dirty changes are emptied on save). | |
# | |
# User.send :include, DirtyMemento | |
# | |
# user = User.find_by_name 'kares' | |
# | |
# assert ! user.name_changed? |
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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<!-- | |
Oracle WebLogic MBean Maker Maven Sample Build | |
- {weblogic.home} should point to the server installation | |
- {bea.modules} is expected to hold the weblogic "shared" jars | |
- sources are expected to live under 'src' folder | |
- the src folder is expected to contain the SampleAsserter.xml |
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
/*! | |
* Linkselect jQuery Plug-in | |
* | |
* Copyright 2008 Giva, Inc. (http://www.givainc.com/labs/) | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 |
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
# ActsAsCommentable | |
module Commentable #:nodoc: | |
def self.included(base) | |
base.extend ClassMethods | |
end | |
module ClassMethods | |
def acts_as_commentable | |
has_many :comments, :as => :commentable, :dependent => :destroy, :order => 'created_at ASC' |
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
/** | |
* Calculate the time zone offset with DST ! | |
* e.g. Prague - if DST enabled ? -60 (summer) : -120 (winter) | |
* | |
* NOTE: this is to be compatible to how Rails helper | |
* time_zone_options_for_select renders zones e.g. : | |
* - in summer (GMT+01:00) Prague | |
* - in winter (GMT+02:00) Prague | |
*/ | |
function getTimeZoneOffsetDST() { |
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
/** | |
* $.klass is a full port of Prototype's Class.create ! | |
* | |
* This code is based on the jQuery port of the Low Pro behavior framework | |
* that was originally written for Prototype. | |
* @see http://github.com/danwrong/low-pro-for-jquery | |
*/ | |
(function($) { | |
var addMethods = function(source) { |