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
| login: &login | |
| adapter: mysql | |
| encoding: utf8 | |
| reconnect: false | |
| pool: 5 | |
| username: ritter2 | |
| password: ritter2 | |
| socket: /var/run/mysqld/mysqld.sock | |
| development: |
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
| var Hotkey = (function(){ | |
| var modifiers = ['ctrl', 'shift', 'alt']; | |
| var hotkeys = $H(); | |
| return { | |
| add: function(keyCombination, behavior, options){ | |
| var keys = keyCombination.split('+'); | |
| var mods = keys.union(modifiers); | |
| var key = keys.without.apply(keys, modifiers).reduce(); | |
| if(Object.isArray(key)) throw "Error: Hotkey can only contain one key that is not a modifier"; | |
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
| <?xml version="1.0" encoding="ISO-8859-1"?> | |
| <xsl:transform version="1.0" | |
| xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
| <!-- omit xml declaration --> | |
| <xsl:output method="xml" omit-xml-declaration="yes" /> | |
| <!-- grab tags --> | |
| <xsl:template match="*"> | |
| <xsl:text>{</xsl:text> |
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
| Object.extend(Array.prototype, { | |
| union: function(otherArray){ | |
| if(!Object.isArray(otherArray)) return this; | |
| return this.without.apply(this, this.without.apply(this, otherArray)); | |
| } | |
| } |
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
| //Put on a text area in java | |
| String action = "'return Event.noBubble( event, RSACommon.limitLength( this, " + maxLength + " ) )'"; | |
| javascript = " onkeypress=" + action + | |
| " onkeyup=" + action + | |
| " onkeydown=" + action + | |
| //RSACommon | |
| limitLength: function( elem, maxLength ) { | |
| if( elem.value.length > maxLength ) { | |
| elem.value = elem.value.substring( 0, maxLength ); |
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
| var remove = true; | |
| $('time').options.each(function(element){ | |
| if(remove) element.remove(); | |
| remove = !remove; | |
| }); |
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
| document.observe('a:a', alert); // will call alert(event) | |
| document.fire('a:a'); |
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 CreateUsers < ActiveRecord::Migration | |
| def self.up | |
| create_table :users do |t| | |
| t.string :username, :null => false # optional, you can use email instead, or both | |
| t.string :email, :null => false # optional, you can use login instead, or both | |
| t.string :crypted_password, :null => false # optional, see below | |
| t.string :password_salt, :null => false # optional, but highly recommended | |
| t.string :persistence_token, :null => false # required | |
| t.string :single_access_token, :null => false # optional, see Authlogic::Session::Params | |
| t.string :perishable_token, :null => false # optional, see Authlogic::Session::Perishability |
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
| //Called on dom:ready | |
| buttonDiv.observe('click', instantEstimate.submitOrder.bindAsEventListener(instantEstimate)); | |
| //instance method on instantEstimate | |
| submitOrder: function(event){ | |
| event.stop(); | |
| if(this.isSubmitting){ | |
| return; | |
| } | |
| if(this.pendingSave || this.request){ |
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
| <html> | |
| <head> | |
| <title></title> | |
| <script type="text/javascript" language="javascript" charset="utf-8"> | |
| function test(){ | |
| var div = document.getElementById('div'); | |
| div.style.visibility = 'hidden'; | |
| alert(div.style.visibility); | |
| } | |
| </script> |