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
$body | |
.append(welcome_dialog) | |
$#gist-live-welcome | |
.hide() | |
.center() | |
.gradient({ | |
from: '003366' | |
,to: '333333' |
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
# | |
# Logical inverter! | |
require 'rubygems' | |
require 'ruby2ruby' | |
class Sexp | |
def to_ruby | |
Ruby2Ruby.new.process(self) | |
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
function do_send() { | |
var method = [].shift.apply(arguments); | |
var payload = {id:id++, method: method, params:arguments}; | |
socket.send(JSON.stringify(payload)+"\r\n"); | |
} |
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
_.tag_input | |
.keyup_size_to_fit(); | |
.keybind('tab', edit_id) | |
.keybind('shift+3', edit_id) | |
.keybind('space', edit_id) | |
.keybind('shift+tab', edit_classes) | |
.keybind('.', edit_classes); | |
_.id_input |
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
//oh... | |
if([].length > 0) | |
if([].length) | |
//DUH |
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
eval (__DIR__+".irbrc").read if (__DIR__+".irbrc").exist? |
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
_(textarea) | |
.keybind('ctrl+left', function() { | |
_(this).parent_node().parent_node().edit_in_place(); | |
}) | |
.keybind('ctrl+shift+left', function() { | |
var node = _(this).parent_node(); | |
node.parent_node().before(node); | |
textarea.focus(); | |
}) | |
.keybind('ctrl+right', function() { |
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
$('div').dblclick(function() { | |
var el = $(this); | |
el | |
.hide() | |
.after($('<input name="something" type="text">') | |
.val(el.html()) | |
.blur(function() { | |
el | |
.html($(this).val()) | |
.show(); |
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>now... With jQuery</title> | |
<script src='javascripts/jquery-1.2.3.pack.js?'></script> | |
<script src='jquery.border_layout-0.0.0.js?'></script> | |
<style> | |
#document { | |
width: 250px; | |
background-color: pink; } | |
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
jQuery.fn.slider = function() { | |
var handle = this; | |
function drag_handler(e) { | |
// offset the mouse position half of the handles width | |
var pos = e.pageX; | |
var container = handle.siblings('.slider_bar'); | |
var offset = container.offset() | |
pos = Math.min(Math.max(pos, offset.left), offset.left + container.width()); | |